Skip to content

Commit

Permalink
assorted fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolcl committed May 1, 2016
1 parent 7e87429 commit 3bcdabb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 8 additions & 5 deletions cmdlnsynth/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ int main(int argc, char *argv[])
signal(SIGINT, signalHandler);
signal(SIGTERM, signalHandler);
synth = new SynthController();
QObject::connect(synth->renderer(), &SynthRenderer::playbackStopped, &app, &QCoreApplication::quit);
QObject::connect(&app, &QCoreApplication::aboutToQuit, synth, &QObject::deleteLater);
QObject::connect(synth->renderer(), &SynthRenderer::playbackStopped, &app, &QCoreApplication::quit);
QObject::connect(synth->renderer(), &SynthRenderer::finished, &app, &QCoreApplication::quit);
synth->renderer()->initReverb(EAS_PARAM_REVERB_HALL);
QStringList args = app.arguments();
for(int i = 1; i < args.length(); ++i) {
QFile argFile(args[i]);
if (argFile.exists()) {
synth->renderer()->playFile(argFile.fileName());
if (args.length() > 1) {
for(int i = 1; i < args.length(); ++i) {
QFile argFile(args[i]);
if (argFile.exists()) {
synth->renderer()->playFile(argFile.fileName());
}
}
}
synth->start();
Expand Down
5 changes: 3 additions & 2 deletions libsvoxeas/synthrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ SynthRenderer::run()
size_t bytes = 0;
QCoreApplication::sendPostedEvents();
if (m_isPlaying) {
getPlaybackLocation();
int t = getPlaybackLocation();
emit playbackTime(t);
}
if (m_easData != 0)
{
Expand Down Expand Up @@ -432,7 +433,7 @@ SynthRenderer::closePlayback()
m_isPlaying = false;
}

long
int
SynthRenderer::getPlaybackLocation()
{
EAS_I32 playTime = 0;
Expand Down
3 changes: 2 additions & 1 deletion libsvoxeas/synthrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SynthRenderer : public QObject
void preparePlayback();
bool playbackCompleted();
void closePlayback();
long getPlaybackLocation();
int getPlaybackLocation();

public slots:
void subscription(MidiPort* port, Subscription* subs);
Expand All @@ -69,6 +69,7 @@ public slots:
signals:
void finished();
void playbackStopped();
void playbackTime(int time);

private:
bool m_Stopped;
Expand Down

0 comments on commit 3bcdabb

Please sign in to comment.