Commit 0f7a603e authored by Christian Esken's avatar Christian Esken
Browse files

Configuration menu is now using Tabs to provide a more standard,

  convenient and pleasing layout
 Sound Menu: Play button reflects playback status and shows either
  "Play" or "Pause"
 Bugfixes and Features (CCBUGS, as most bugs are already closed). Hint: Some
bugs might have actually been alreay fixed ibn KDE4.11 or KDE4.12.

Bug ID	Severity	Summary
CCBUGS:317926  critical kmix start delayed on 20 seconds
CCBUGS:315383	normal	mpris volume/play status not in sync with app in kmix
applet
CCBUGS:299477	normal	KMix Does Not Unmute Master Audio Channel
CCBUGS:256854	normal	Tray popup obscures vertical panel
CCBUGS:304144	normal	KMix does not distinguish separate channels on one
volume control
CCBUGS:296951	normal	Tray plasmoid scroll/hiding issues [read description]
CCBUGS:303608	crash	Kmix crashed after selecting Amarok as master
CCBUGS:214854	normal	kmix size is not restored by session management, only
position.
CCBUGS:319600	major	KMix volume icon is unstale during playback
parent c348c90d
......@@ -6,6 +6,9 @@ find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
# Do not yet REQUIRE Phonon. Hint: As long as we do not find_package(), ${KDE4_PHONON_LIBS} will be empty below, but that should not hurt.
#find_package(Phonon REQUIRED)
find_package(Alsa)
macro_optional_find_package(PulseAudio "0.9.12")
......@@ -110,6 +113,7 @@ set(kmix_KDEINIT_SRCS ${kmix_adaptor_SRCS} ${kmix_backend_SRCS}
gui/dialogchoosebackends.cpp
gui/guiprofile.cpp
gui/osdwidget.cpp
core/MediaController.cpp
core/mixertoolbox.cpp
core/kmixdevicemanager.cpp
core/ControlManager.cpp
......@@ -125,7 +129,7 @@ set(kmix_KDEINIT_SRCS ${kmix_adaptor_SRCS} ${kmix_backend_SRCS}
kde4_add_kdeinit_executable( kmix ${kmix_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmix ${KDE4_SOLID_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTXML_LIBRARY})
target_link_libraries(kdeinit_kmix ${KDE4_SOLID_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTXML_LIBRARY} ${KDE4_PHONON_LIBS})
#target_link_libraries(kdeinit_kmix ${KDE4_KUTILS_LIBS} /home/kde/workspace/kdelibs/build/lib/libsolid.so.4.7.0 ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTXML_LIBRARY})
if (HAVE_LIBASOUND2)
......@@ -153,14 +157,13 @@ install(TARGETS kmix ${INSTALL_TARGETS_DEFAULT_ARGS} )
# core/ControlPool.cpp
core/GlobalConfig.cpp
core/MasterControl.cpp
core/MediaController.cpp
core/mixer.cpp
core/mixset.cpp
core/mixdevice.cpp
core/volume.cpp
core/mixertoolbox.cpp
core/kmixdevicemanager.cpp
backends/mixer_mpris2.cpp
backends/mixer_backend.cpp
)
#qt4_add_dbus_adaptor(kded_kmixd_SRCS org.kde.KMixD.xml kmixd.h Mixer)
......@@ -168,7 +171,7 @@ install(TARGETS kmix ${INSTALL_TARGETS_DEFAULT_ARGS} )
kde4_add_plugin(kded_kmixd ${kded_kmixd_SRCS})
target_link_libraries(kded_kmixd ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTXML_LIBRARY})
target_link_libraries(kded_kmixd ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTXML_LIBRARY} ${KDE4_PHONON_LIBS})
if (HAVE_LIBASOUND2)
target_link_libraries(kded_kmixd ${ASOUND_LIBRARY})
......@@ -197,6 +200,7 @@ set(kmixctrl_KDEINIT_SRCS ${kmix_adaptor_SRCS} ${kmix_backend_SRCS}
# core/ControlPool.cpp
core/GlobalConfig.cpp
core/MasterControl.cpp
core/MediaController.cpp
core/mixer.cpp
core/mixset.cpp
core/mixdevice.cpp
......@@ -210,7 +214,7 @@ set(kmixctrl_KDEINIT_SRCS ${kmix_adaptor_SRCS} ${kmix_backend_SRCS}
kde4_add_kdeinit_executable( kmixctrl ${kmixctrl_KDEINIT_SRCS})
target_link_libraries(kdeinit_kmixctrl ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTXML_LIBRARY})
target_link_libraries(kdeinit_kmixctrl ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTXML_LIBRARY} ${KDE4_PHONON_LIBS})
if (HAVE_LIBASOUND2)
target_link_libraries(kdeinit_kmixctrl ${ASOUND_LIBRARY})
......
V1.90
Version shipped with KDE3.1
KDE v4.13
- Clearly rearranged configuration menu, using Tabs.
- Sound Menu: Play button reflects playback status and shows either "Play" or "Pause"
V1.91
- Multiple soundcards on ALSA are now supported
- Mixer device names are now shown with a vertical label (saves space and looks nice)
- MixerDevice categories. Allows to distribute devices on "New Mixer Tab...". It is used
in the panel applet to show only important devices initally.
- Much nicer "New Mixer Tab..." dialog
- Bugfixes and Features:
Bug ID Severity Summary
317926 critical kmix start delayed on 20 seconds
315383 normal mpris volume/play status not in sync with app in kmix applet
299477 normal KMix Does Not Unmute Master Audio Channel
256854 normal Tray popup obscures vertical panel
304144 normal KMix does not distinguish separate channels on one volume control
296951 normal Tray plasmoid scroll/hiding issues [read description]
303608 crash Kmix crashed after selecting Amarok as master and instantly crashed when changing song. Volumes in exeption of the integrated subwoofer go fine; the built-in woofer must be changed trough Alsa, and Amarok must be volumed up/down by it's bar.
214854 normal kmix size is not restored by session management, only position.
319600 major KMix volume icon is unstale during playback
v3.0
- KDE 4 version
v3.5
- This is the KDE 4.2 head version
- Wish 132330: On-screen display of volume level
- Wish 157701: Smaller neater dockarea popup
- Bug 161393: kmix does not associate hotplugged USB HID volume control
- Bug 168658: kmix - master channel missing
- Bug 172958: OSD doesn't update when volume is changed using keyboard
- Feature : Automatically grab XF86VolumeUp, XF86VolumeDown and XF86VolumeMute (done)
KDE v4.11
- Full Sound Menu: Media Player control support
v3.8
- Feature : KMix has now a profile for TerraTec DMX6Fire cards and is able to handle it's weird volume controls
v3.6
- This is the KDE 4.4 version
......@@ -30,5 +31,25 @@ v3.6
i001: When the user redefines the automatially grabbed XF86Volume* keys, he doesn't have an easy possibilty to get them back, because they are now marked as "no shortcut" in the global shortcut registry. The user must go the KDE system settings module "global shortcuts" and reset them to their default. No user will wfind that!!! So this should be possible inside KMix (ShortcutsDialog or a button "reset volume keys" in the configuration dialog).
v3.8
- Feature : KMix has now a profile for TerraTec DMX6Fire cards and is able to handle it's weird volume controls
v3.5
- This is the KDE 4.2 head version
- Wish 132330: On-screen display of volume level
- Wish 157701: Smaller neater dockarea popup
- Bug 161393: kmix does not associate hotplugged USB HID volume control
- Bug 168658: kmix - master channel missing
- Bug 172958: OSD doesn't update when volume is changed using keyboard
- Feature : Automatically grab XF86VolumeUp, XF86VolumeDown and XF86VolumeMute (done)
v3.0
- KDE 4 version
V1.91
- Multiple soundcards on ALSA are now supported
- Mixer device names are now shown with a vertical label (saves space and looks nice)
- MixerDevice categories. Allows to distribute devices on "New Mixer Tab...". It is used
in the panel applet to show only important devices initally.
- Much nicer "New Mixer Tab..." dialog
V1.90
Version shipped with KDE3.1
......@@ -21,7 +21,8 @@
#include "KMixApp.h"
#include "apps/kmix.h"
#include <core/ControlManager.h>
#include "core/ControlManager.h"
#include "core/GlobalConfig.h"
#include <kdebug.h>
......@@ -30,6 +31,8 @@ bool KMixApp::_keepVisibility = false;
KMixApp::KMixApp()
: KUniqueApplication(), m_kmix( 0 )
{
GlobalConfig::init();
// We must disable QuitOnLastWindowClosed. Rationale:
// 1) The normal state of KMix is to only have the dock icon shown.
// 2a) The dock icon gets reconstructed, whenever a soundcard is hotplugged or unplugged.
......@@ -105,6 +108,7 @@ KMixApp::newInstance()
// based on m_kmix to handle this race condition.
// Specific protection for the activation-prior-to-full-construction
// case exists above in the 'already running case'
GlobalConfig::init();
m_kmix = new KMixWindow(_keepVisibility);
//connect(this, SIGNAL(stopUpdatesOnVisibility()), m_kmix, SLOT(stopVisibilityUpdates()));
if ( isSessionRestored() && KMainWindow::canBeRestored(0) )
......
This diff is collapsed.
......@@ -40,7 +40,8 @@ class KAction;
#include <kxmlguiwindow.h>
// KMix
class KMixPrefDlg;
#include "core/GlobalConfig.h"
class KMixDockWidget;
class KMixerWidget;
class KMixWindow;
......@@ -89,7 +90,7 @@ KMixWindow : public KXmlGuiWindow
void saveVolumes();
void saveVolumes(QString postfix);
void saveConfig();
virtual void applyPrefs( KMixPrefDlg *prefDlg );
virtual void applyPrefs();
void recreateGUI(bool saveView);
void recreateGUI(bool saveConfig, const QString& mixerId, bool forceNewTab);
void recreateGUIwithSavingView();
......@@ -104,25 +105,19 @@ KMixWindow : public KXmlGuiWindow
KAccel *m_keyAccel;
KAction* _actionShowMenubar;
// move many of the following to a central static configuration object
// (they come from the KMix config file, so they are really "static".
bool m_showDockWidget;
bool trayVolumePopupEnabled;
private:
bool m_onLogin;
bool allowAutostart;
bool m_beepOnVolumeChange;
/**
* configSnapshot is used to hold the original state before modifications in the preferences dialog
*/
GlobalConfigData configDataSnapshot;
bool m_startVisible;
bool m_visibilityUpdateAllowed;
bool m_multiDriverMode; // Not officially supported.
bool m_autouseMultimediaKeys; // Due to message freeze, not in config dialog in KDE4.4
bool forceNotifierRebuild;
KTabWidget *m_wsMixers;
KMixPrefDlg *m_prefDlg;
KMixDockWidget *m_dockWidget;
QString m_hwInfoString;
QString m_defaultCardOnStart;
......
......@@ -29,6 +29,7 @@
#include <kdebug.h>
#include "gui/kmixtoolbox.h"
#include "core/GlobalConfig.h"
#include "core/mixer.h"
#include "core/version.h"
......@@ -55,6 +56,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
KApplication app( false );
GlobalConfig::init();
// create mixers
QString dummyStringHwinfo;
MixerToolBox::instance()->initMixer(false, QList<QString>(), dummyStringHwinfo);
......
......@@ -40,6 +40,7 @@
#include <kpluginloader.h>
// KMix
#include "core/GlobalConfig.h"
#include "core/mixertoolbox.h"
#include "core/kmixdevicemanager.h"
#include "core/version.h"
......@@ -84,6 +85,8 @@ KMixD::KMixD(QObject* parent, const QList<QVariant>&) :
// disable delete-on-close because KMix might just sit in the background waiting for cards to be plugged in
//setAttribute(Qt::WA_DeleteOnClose, false);
GlobalConfig::init();
//initActions(); // init actions first, so we can use them in the loadConfig() already
loadConfig(); // Load config before initMixer(), e.g. due to "MultiDriver" keyword
//initActionsLate(); // init actions that require a loaded config
......
......@@ -79,27 +79,33 @@ void Mixer_Backend::freeMixDevices()
m_mixDevices.clear();
}
bool Mixer_Backend::openIfValid() {
bool valid = false;
bool Mixer_Backend::openIfValid()
{
int ret = open();
if ( ret == 0 && (m_mixDevices.count() > 0 || _mixer->isDynamic())) {
valid = true;
// A better ID is now calculated in mixertoolbox.cpp, and set via setID(),
// but we want a somehow usable fallback just in case.
if ( needsPolling() ) {
if (ret == 0 && (m_mixDevices.count() > 0 || _mixer->isDynamic()))
{
// Hint: _id is probably not yet perfectly set, as it requires the value from open() and an external
// counter. Thus we start the Timer while _id is not properly set. But it will be done immediately
// by the caller of this method.
// Future directions: Do the counter calculation in the backend. It really belongs there, as it is part of
// the PK calculation. Probably provide a standard implementation in Mixer_Backend itself. Also the
// key should be an own class, like: MixerKey(QString backend, QString baseId, int cardInstance)
if (needsPolling())
{
_pollingTimer->start(POLL_OSS_RATE_FAST);
}
else {
else
{
// The initial state must be read manually
QTimer::singleShot( POLL_OSS_RATE_FAST, this, SLOT(readSetFromHW()) );
QTimer::singleShot( POLL_OSS_RATE_FAST, this, SLOT(readSetFromHW()));
}
} // could be opened
return true; // could be opened
}
else
{
//shutdown();
return false; // could not open
}
return valid;
}
bool Mixer_Backend::isOpen() {
......
......@@ -101,6 +101,7 @@ protected:
virtual bool moveStream( const QString& id, const QString& destId );
// Future directions: Move media*() methods to MediaController class
virtual int mediaPlay(QString ) { return 0; }; // implement in the backend if it supports it
virtual int mediaPrev(QString ) { return 0; }; // implement in the backend if it supports it
virtual int mediaNext(QString ) { return 0;}; // implement in the backend if it supports it
......
This diff is collapsed.
......@@ -100,10 +100,11 @@ public:
public slots:
void trackChangedIncoming(QVariantMap msg);
void volumeChangedIncoming(QString,QVariantMap,QStringList);
void onPropertyChange(QString,QVariantMap,QStringList);
signals:
void volumeChanged(MPrisControl* mad, double);
void playbackStateChanged(MPrisControl* mad, MediaController::PlayState);
};
class Mixer_MPRIS2 : public Mixer_Backend
......@@ -132,20 +133,36 @@ public:
virtual int mediaNext(QString id);
virtual int mediaControl(QString id, QString command);
static MediaController::PlayState mprisPlayStateString2PlayState(const QString& playbackStatus);
public slots:
void volumeChanged(MPrisControl *mad, double);
void playbackStateChanged(MPrisControl* mad, MediaController::PlayState);
void newMediaPlayer(QString name, QString oldOwner, QString newOwner);
void addMprisControlAsync(QString arg1);
void notifyToReconfigureControlsAsync(QString streamId);
void notifyToReconfigureControls();
void announceControlListAsync(QString streamId);
private slots:
// asynchronous announce call slots
void announceControlList();
void announceGUI();
void announceVolume();
// Async QDBusPendingCallWatcher's
void plugControlIdIncoming(QDBusPendingCallWatcher* watcher);
void mediaContolReplyIncoming(QDBusPendingCallWatcher* watcher);
void watcherMediaControl(QDBusPendingCallWatcher* watcher);
void watcherPlugControlId(QDBusPendingCallWatcher* watcher);
void watcherInitialVolume(QDBusPendingCallWatcher* watcher);
void watcherInitialPlayState(QDBusPendingCallWatcher* watcher);
private:
// Helpers for the watchers
MPrisControl* watcherHelperGetMPrisControl(QDBusPendingCallWatcher* watcher);
private:
// void asyncAddMprisControl(QString busDestination);
void messageQueueThreadLoop();
// void messageQueueThreadLoop();
int addAllRunningPlayersAndInitHotplug();
void volumeChangedInternal(shared_ptr<MixDevice> md, int volumePercentage);
QString busDestinationToControlId(const QString& busDestination);
......
......@@ -87,9 +87,14 @@ Mixer_Backend* OSS_getMixer( Mixer* mixer, int device )
return l_mixer;
}
Mixer_OSS::Mixer_OSS( Mixer* mixer, int device) : Mixer_Backend(mixer, device)
Mixer_OSS::Mixer_OSS(Mixer* mixer, int device) :
Mixer_Backend(mixer, device)
{
if( device == -1 ) m_devnum = 0;
if (device == -1)
{
m_devnum = 0;
}
m_fd = -1; // point to an invalid FD
}
Mixer_OSS::~Mixer_OSS()
......@@ -237,6 +242,7 @@ QString Mixer_OSS::errorText(int mixer_error)
break;
default:
l_s_errmsg = Mixer_Backend::errorText(mixer_error);
break;
}
return l_s_errmsg;
}
......
......@@ -889,7 +889,7 @@ void Mixer_PULSE::addDevice(devinfo& dev, bool isAppStream)
else if (m_devnum == KMIXPA_APP_CAPTURE && s_mixers.contains(KMIXPA_CAPTURE))
ms = s_mixers[KMIXPA_CAPTURE]->getMixSet();
int maxVol = GlobalConfig::instance().volumeOverdrive ? PA_VOLUME_UI_MAX : PA_VOLUME_NORM;
int maxVol = GlobalConfig::instance().data.volumeOverdrive ? PA_VOLUME_UI_MAX : PA_VOLUME_NORM;
Volume v(maxVol, PA_VOLUME_MUTED, true, false);
v.addVolumeChannels(dev.chanMask);
setVolumeFromPulse(v, dev);
......
......@@ -69,7 +69,7 @@ void ControlManager::announce(QString mixerId, ControlChangeType::Type changeTyp
bool listenerAlreadyProcesed = processedListeners.contains(&listener);
if ( listenerAlreadyProcesed )
{
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
kDebug() << "Skipping already processed listener";
continue;
}
......@@ -77,7 +77,7 @@ void ControlManager::announce(QString mixerId, ControlChangeType::Type changeTyp
{
bool success = QMetaObject::invokeMethod(listener.getTarget(), "controlsChange", Qt::DirectConnection,
Q_ARG(int, changeType));
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
{
kDebug() << "Listener " << listener.getSourceId() <<" is interested in " << mixerId
<< ", " << ControlChangeType::toString(changeType);
......@@ -91,7 +91,7 @@ void ControlManager::announce(QString mixerId, ControlChangeType::Type changeTyp
if (listenersChanged)
{
// The invokeMethod() above has changed the listeners => my Iterator is invalid => restart loop
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
kDebug() << "Listeners modified => restart loop";
listenersChanged = false;
listenersModified = true;
......@@ -103,7 +103,7 @@ void ControlManager::announce(QString mixerId, ControlChangeType::Type changeTyp
}
while ( listenersModified);
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
{
kDebug()
<< "Announcing " << ControlChangeType::toString(changeType) << " for "
......@@ -123,7 +123,7 @@ void ControlManager::announce(QString mixerId, ControlChangeType::Type changeTyp
*/
void ControlManager::addListener(QString mixerId, ControlChangeType::Type changeType, QObject* target, QString sourceId)
{
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
{
kDebug()
<< "Listening to " << ControlChangeType::toString(changeType) << " for "
......@@ -141,7 +141,7 @@ void ControlManager::addListener(QString mixerId, ControlChangeType::Type change
listenersChanged = true;
}
}
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
{
kDebug()
<< "We now have" << listeners.size() << "listeners";
......@@ -170,7 +170,7 @@ void ControlManager::removeListener(QObject* target, QString sourceId)
Listener& listener = it.next();
if (listener.getTarget() == target)
{
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
kDebug()
<< "Stop Listening of " << listener.getSourceId() << " requested by " << sourceId << " from " << target;
it.remove();
......@@ -187,13 +187,13 @@ void ControlManager::warnUnexpectedChangeType(ControlChangeType::Type type, QObj
void ControlManager::shutdownNow()
{
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
kDebug() << "Shutting down ControlManager";
QList<Listener>::iterator it;
for (it = listeners.begin(); it != listeners.end(); ++it)
{
Listener& listener = *it;
if (GlobalConfig::instance().debugControlManager)
if (GlobalConfig::instance().data.debugControlManager)
kDebug()
<< "Listener still connected. Closing it. source=" << listener.getSourceId() << "listener="
<< listener.getTarget()->metaObject()->className();
......
/*
KMix -- KDE's full featured mini mixer
Copyright (C) 2012 Christian Esken <esken@kde.org>
KMix -- KDE's full featured mini mixer
Copyright (C) 2012 Christian Esken <esken@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "GlobalConfig.h"
GlobalConfig GlobalConfig::instanceObj;
// instanceObj must be created "late", so we can refer to the correct application config file kmixrc instead of kderc.
GlobalConfig* GlobalConfig::instanceObj;
GlobalConfig::GlobalConfig() :
KConfigSkeleton()
{
setCurrentGroup("Global");
// General
addItemBool("Tickmarks", data.showTicks, true);
addItemBool("Labels", data.showLabels, true);
addItemBool("VolumeOverdrive", data.volumeOverdrive, false);
addItemBool("VolumeFeedback", data.beepOnVolumeChange, true);
ItemString* is = addItemString("Orientation", data.orientationMainGUIString, "Vertical");
kDebug() << is->name() << is->value();
addItemString("Orientation.TrayPopup", data.orientationTrayPopupString, QLatin1String("Vertical"));
// Sound Menu
addItemBool("showOSD", data.showOSD, true);
addItemBool("AllowDocking", data.showDockWidget, true);
// addItemBool("TrayVolumeControl", data.trayVolumePopupEnabled, true); // removed support in KDE4.13. Always active!
// Startup
addItemBool("AutoStart", data.allowAutostart, true);
addItemBool("VolumeFeedback", data.volumeFeedback, true);
addItemBool("startkdeRestore", data.startkdeRestore, true);
// Debug options: Not in dialog
addItemBool("Debug.ControlManager", data.debugControlManager, false);
addItemBool("Debug.GUI", data.debugGUI, false);
addItemBool("Debug.Volume", data.debugVolume, false);
readConfig();
}
// --- Special READ/WRITE ----------------------------------------------------------------------------------------
void GlobalConfig::usrReadConfig()
{
// kDebug() << "or=" << data.orientationMainGUIString;
// Convert orientation strings to Qt::Orientation
data.convertOrientation();
}
//void GlobalConfig::usrWriteConfig()
//{
// // TODO: Is this any good? When is usrWriteConfig() called? Hopefully BEFORE actually writing. Otherwise
// // I must move this code to #setToplevelOrientation() and #setTraypopupOrientation().
//}
Qt::Orientation GlobalConfigData::getToplevelOrientation()
{
return toplevelOrientation;
}
Qt::Orientation GlobalConfigData::getTraypopupOrientation()
{
return traypopupOrientation;
}
/**
* Converts the orientation strings to Qt::Orientation
*/
void GlobalConfigData::convertOrientation()
{
toplevelOrientation = stringToOrientation(orientationMainGUIString);
traypopupOrientation = stringToOrientation(orientationTrayPopupString);
}
void GlobalConfigData::setToplevelOrientation(Qt::Orientation orientation)
{
toplevelOrientation = orientation;
orientationMainGUIString = orientationToString(toplevelOrientation);
}
void GlobalConfigData::setTraypopupOrientation(Qt::Orientation orientation)
{
traypopupOrientation = orientation;
orientationTrayPopupString = orientationToString(traypopupOrientation);
}
Qt::Orientation GlobalConfigData::stringToOrientation(QString& orientationString)
{
return orientationString == "Horizontal" ? Qt::Horizontal : Qt::Vertical;
}
QString GlobalConfigData::orientationToString(Qt::Orientation orientation)
{
return orientation == Qt::Horizontal ? "Horizontal" : "Vertical";
}
/*
KMix -- KDE's full featured mini mixer
Copyright (C) 2012 Christian Esken <esken@kde.org>
KMix -- KDE's full featured mini mixer
Copyright (C) 2012 Christian Esken <esken@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of