Skip to content

Commit

Permalink
[Plugin] Midi File Import 수정 (#4)
Browse files Browse the repository at this point in the history
* etc)컴파일 에러 수정

형변환으로 인한 컴파일 에러 수정
(형변환이 엄격한 컴파일러에서 에러가 발생)

* fea)midi 파일을 불러올때 미디파일 데이터 갱신하도록 수정

미디 파일 정보를 읽은 후 모든 Model 정보의 signal 함수(dataChanged)을 호출 하도록 수정

* sty)signal 함수(dataInit) 추가

같은 코드에 signal함수를 추가하여 동작하도록 코드 설계 스타일 수정함
  • Loading branch information
mgee044 authored Oct 25, 2021
1 parent e884da7 commit 9ce3988
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class LMMS_EXPORT Model : public QObject
// emitted if properties of the model (e.g. ranges) have changed
void propertiesChanged();

// emitted if init data of the model (e.g midi file import)
void dataInit();

} ;


Expand Down
4 changes: 2 additions & 2 deletions plugins/AudioMixMaster/AudioMixMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ ExtraChannelInfo parseExtraChannelInfo(const QJsonObject &obj)
.inputIsBus = obj["inIsBus"].toBool(false),
.outputIndex = obj["outIdx"].toInt(-1),
.outputIsBus = obj["outIsBus"].toBool(false),
.gain = obj["gain"].toDouble(1.0),
.pan = obj["pan"].toDouble(0.0)
.gain = static_cast<float>(obj["gain"].toDouble(1.0)),
.pan = static_cast<float>(obj["pan"].toDouble(0.0))
};
}

Expand Down
1 change: 1 addition & 0 deletions plugins/MidiImport/MidiImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ bool MidiImport::readSMF( TrackContainer* tc )
}
ccs[ccid].putValue( time, objModel, cc );
}
emit objModel->dataInit();
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/tracks/InstrumentTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
m_midiCCModel[i] = new FloatModel(0.0f, 0.0f, 127.0f, 1.0f, NULL, QString("CC Controller ") + QString::number(i));
connect( m_midiCCModel[i], &FloatModel::dataChanged,
this, [this, i]{ processCCEvent(i); }, Qt::DirectConnection );
connect( m_midiCCModel[i], &FloatModel::dataInit,
this, [this, i]{ processCCEvent(i); }, Qt::DirectConnection );
}

setName( tr( "Default preset" ) );
Expand Down

0 comments on commit 9ce3988

Please sign in to comment.