Mercurial > hg > dmlib
diff edmain.cpp @ 384:e5220ff48bc8
Slowly working on the editor.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 18 Oct 2012 20:10:13 +0300 |
parents | 05e85401480a |
children | 28a74940f2b6 |
line wrap: on
line diff
--- a/edmain.cpp Thu Oct 18 20:08:59 2012 +0300 +++ b/edmain.cpp Thu Oct 18 20:10:13 2012 +0300 @@ -213,17 +213,17 @@ // view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); - updateMenuStates(); + initEffectsAndResources(); statusMsg("Application started."); } DemoEditor::~DemoEditor() { - dmPrint(1, "Shutting down.\n"); + statusMsg("Shutting down."); settingsSave(); -// delete view; + delete demoView; delete tl; historyReset(); @@ -246,26 +246,34 @@ } +void DemoEditor::updateTimelineView() +{ + timelineWaveform->setOffset(20000); + timelineWaveform->setScale(10); + timelineWaveform->setTime(200010); +} + + int DemoEditor::initEffectsAndResources() { int err; // Initialize resource subsystem - dmPrint(1, "Initializing resources subsystem.\n"); + statusMsg("Initializing resources subsystem."); if ((err = reopenResources()) != DMERR_OK) return err; // Load resources - dmPrint(1, "Loading resources, please wait...\n"); + statusMsg("Loading resources, please wait..."); if ((err = loadResources()) != DMERR_OK) { dmError("Error loading resources, %d: %s.\n", err, dmErrorStr(err)); return err; } - dmPrint(1, "Initializing effects, etc.\n"); // Final initializations + statusMsg("Initializing custom demo data."); if ((err = engine.demoInit(&engine)) != DMERR_OK) { dmError("Failure in demoInit(), %d: %s\n", @@ -274,6 +282,7 @@ } // Initialize effects + statusMsg("Initializing effects ..."); if ((err = engineInitializeEffects(&engine)) != DMERR_OK) { dmError("Effects initialization failed, %d: %s\n", @@ -281,6 +290,15 @@ return err; } + // Etc. + timelineWaveform->setWaveform( + engine.audioRes->rdata, engine.audioRes->rdataSize, + engine.optAfmt.format, engine.optAfmt.channels, + engine.optAfmt.freq); + + updateTimelineView(); + updateMenuStates(); + update(); return DMERR_OK; }