Skip to content

Commit 3bcdabb

Browse files
committed
assorted fixes
1 parent 7e87429 commit 3bcdabb

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

cmdlnsynth/main.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ int main(int argc, char *argv[])
4141
signal(SIGINT, signalHandler);
4242
signal(SIGTERM, signalHandler);
4343
synth = new SynthController();
44-
QObject::connect(synth->renderer(), &SynthRenderer::playbackStopped, &app, &QCoreApplication::quit);
4544
QObject::connect(&app, &QCoreApplication::aboutToQuit, synth, &QObject::deleteLater);
45+
QObject::connect(synth->renderer(), &SynthRenderer::playbackStopped, &app, &QCoreApplication::quit);
46+
QObject::connect(synth->renderer(), &SynthRenderer::finished, &app, &QCoreApplication::quit);
4647
synth->renderer()->initReverb(EAS_PARAM_REVERB_HALL);
4748
QStringList args = app.arguments();
48-
for(int i = 1; i < args.length(); ++i) {
49-
QFile argFile(args[i]);
50-
if (argFile.exists()) {
51-
synth->renderer()->playFile(argFile.fileName());
49+
if (args.length() > 1) {
50+
for(int i = 1; i < args.length(); ++i) {
51+
QFile argFile(args[i]);
52+
if (argFile.exists()) {
53+
synth->renderer()->playFile(argFile.fileName());
54+
}
5255
}
5356
}
5457
synth->start();

libsvoxeas/synthrenderer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ SynthRenderer::run()
225225
size_t bytes = 0;
226226
QCoreApplication::sendPostedEvents();
227227
if (m_isPlaying) {
228-
getPlaybackLocation();
228+
int t = getPlaybackLocation();
229+
emit playbackTime(t);
229230
}
230231
if (m_easData != 0)
231232
{
@@ -432,7 +433,7 @@ SynthRenderer::closePlayback()
432433
m_isPlaying = false;
433434
}
434435

435-
long
436+
int
436437
SynthRenderer::getPlaybackLocation()
437438
{
438439
EAS_I32 playTime = 0;

libsvoxeas/synthrenderer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SynthRenderer : public QObject
5959
void preparePlayback();
6060
bool playbackCompleted();
6161
void closePlayback();
62-
long getPlaybackLocation();
62+
int getPlaybackLocation();
6363

6464
public slots:
6565
void subscription(MidiPort* port, Subscription* subs);
@@ -69,6 +69,7 @@ public slots:
6969
signals:
7070
void finished();
7171
void playbackStopped();
72+
void playbackTime(int time);
7273

7374
private:
7475
bool m_Stopped;

0 commit comments

Comments
 (0)