Skip to content

Commit

Permalink
Cleaned up Creox class constructor and add a nice icon for the Jack
Browse files Browse the repository at this point in the history
settings page.
  • Loading branch information
laudrup committed Jun 21, 2011
1 parent 53fa781 commit 89abc8e
Showing 1 changed file with 13 additions and 85 deletions.
98 changes: 13 additions & 85 deletions creox/creox.cpp
Expand Up @@ -69,19 +69,11 @@ Creox::Creox(QWidget *parent)


m_playAction = new KAction(KIcon("media-playback-start"), i18n("&Play"), this); m_playAction = new KAction(KIcon("media-playback-start"), i18n("&Play"), this);


//m_playAction->setIcon(KIcon("document-new"));
m_playAction->setShortcut(Qt::Key_Space); m_playAction->setShortcut(Qt::Key_Space);
actionCollection()->addAction("playAction", m_playAction); actionCollection()->addAction("playAction", m_playAction);
connect(m_playAction, SIGNAL(triggered(bool)), connect(m_playAction, SIGNAL(triggered(bool)),
SLOT(slotStartStopEffector())); SLOT(slotStartStopEffector()));


/*
QString::fromLatin1("system-run"),
Qt::Key_Space, this,
SLOT(slotStartStopEffector()),
actionCollection(), "playAction");
*/

const QString saveNewPresetString(i18n("&Save New Preset...")); const QString saveNewPresetString(i18n("&Save New Preset..."));
m_savePresetAction = new KAction(KIcon("document-save"), saveNewPresetString, this); m_savePresetAction = new KAction(KIcon("document-save"), saveNewPresetString, this);
m_savePresetAction->setShortcut(Qt::CTRL + Qt::Key_S); m_savePresetAction->setShortcut(Qt::CTRL + Qt::Key_S);
Expand All @@ -91,102 +83,38 @@ Creox::Creox(QWidget *parent)
m_newPresetFolderAction = new KAction(KIcon("document-new"), i18n("&New Preset Folder..."), this); m_newPresetFolderAction = new KAction(KIcon("document-new"), i18n("&New Preset Folder..."), this);
m_newPresetFolderAction->setShortcut(Qt::CTRL + Qt::Key_N); m_newPresetFolderAction->setShortcut(Qt::CTRL + Qt::Key_N);
actionCollection()->addAction("newPresetFolderAction", m_newPresetFolderAction); actionCollection()->addAction("newPresetFolderAction", m_newPresetFolderAction);
//presetActionMenu->addAction(m_newPresetFolderAction);
connect(m_newPresetFolderAction, SIGNAL(activated()), SLOT(slotNewPresetFolder())); connect(m_newPresetFolderAction, SIGNAL(activated()), SLOT(slotNewPresetFolder()));


/*
QString::fromLatin1("document-save"),
Qt::CTRL+Qt::Key_S, this, SLOT(slotSaveNewPreset()),
actionCollection(), "saveNewPresetAction");
*/

KActionMenu* const presetActionMenu = new KActionMenu(KIcon("document-save"), saveNewPresetString, this); KActionMenu* const presetActionMenu = new KActionMenu(KIcon("document-save"), saveNewPresetString, this);
actionCollection()->addAction("presetActionMenu", presetActionMenu); actionCollection()->addAction("presetActionMenu", presetActionMenu);
connect(presetActionMenu, SIGNAL(activated()), SLOT(slotSaveNewPreset())); connect(presetActionMenu, SIGNAL(activated()), SLOT(slotSaveNewPreset()));


/*
QString::fromLatin1("document-save"),
actionCollection(), "presetActionMenu");
*/

/*
QString::fromLatin1("folder-new"),
Qt::CTRL+Qt::Key_N, this,
SLOT(slotNewPresetFolder()),
actionCollection(),
"newPresetFolderAction");
presetActionMenu->insert(m_newPresetFolderAction);
connect(presetActionMenu, SIGNAL(activated()), this,
SLOT(slotSaveNewPreset()));
*/
setupGUI(); setupGUI();


/* m_effectKeeper = new EffectKeeper(this, "m_effectKeeper");
menuBar()->insertItem(i18n("&View"), dockHideShowMenu(), -1, 1);
*/

m_effectKeeper = new EffectKeeper(this, "m_effectKeeper");

initEffectsGui();

m_effectKeeper->activate();
m_chainView->activate();

//try{
m_presetView->loadPresets();

/*
}catch(Cr::CrException_presetDataFileError& error){
KMessageBox::error(0, error.what());
#ifdef _DEBUG
std::cerr << error.what().latin1() << "\n";
#endif
}
//!! preliminary fix !!
fixEffectsWidth();


*/ initEffectsGui();


// event dispatcher catches exceptions from the working dsp thread m_effectKeeper->activate();
m_ptrEventDispatcher = new CrThreadEventDispatcher(kapp); m_chainView->activate();
m_presetView->loadPresets();


// start timer to remove splashScreen // event dispatcher catches exceptions from the working dsp thread
QTimer::singleShot(g_iSplashScreenTimeOut, this, SLOT(removeSplashScreen())); m_ptrEventDispatcher = new CrThreadEventDispatcher(kapp);


/* // start timer to remove splashScreen
readDockConfig(); QTimer::singleShot(g_iSplashScreenTimeOut, this, SLOT(removeSplashScreen()));
*/
} }


Creox::~Creox() Creox::~Creox()
{ {
//try { if (m_effectKeeper->threadEffector()->getStatus() == ThreadEffector::status_Run) {

m_effectKeeper->stop();
if (m_effectKeeper->threadEffector()->getStatus() == }
ThreadEffector::status_Run)
{
m_effectKeeper->stop();
}


m_presetView->savePresets(); m_presetView->savePresets();
m_effectKeeper->shutdown(); m_effectKeeper->shutdown();
Settings::self()->writeConfig(); Settings::self()->writeConfig();
/* }
catch(Cr::CrException_presetDataFileError& error){
KMessageBox::error(0, error.what());
#ifdef _DEBUG
std::cerr << error.what().latin1() << "\n";
#endif
} */

// there are so many bugs in the kdelibs dock implementation,
// that I can't set this option on
// XXX!
//writeDockConfig();
#ifdef _DEBUG
std::cerr << "Creox deleted..." << "\n";
#endif
} }


void Creox::removeSplashScreen() void Creox::removeSplashScreen()
Expand Down Expand Up @@ -428,7 +356,7 @@ void Creox::showPrefDialog()
KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self()); KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self());
dialog->setFaceType(KPageDialog::List); dialog->setFaceType(KPageDialog::List);
AudioPrefs* audioPrefs = new AudioPrefs(0); AudioPrefs* audioPrefs = new AudioPrefs(0);
dialog->addPage(audioPrefs, i18n("Jack audio configuration")); dialog->addPage(audioPrefs, i18n("Jack audio configuration"), "audio-card");
// XXX: Connect this signal to restart sound service // XXX: Connect this signal to restart sound service
//connect(dialog, SIGNAL(settingsChanged(const QString&)), audioPrefs, SLOT(loadSettings())); //connect(dialog, SIGNAL(settingsChanged(const QString&)), audioPrefs, SLOT(loadSettings()));
dialog->show(); dialog->show();
Expand Down

0 comments on commit 89abc8e

Please sign in to comment.