Mute button + RT shows up immediately now in Windows Mixer
see issue 803
This commit is contained in:
parent
47cd6fc04e
commit
58efd5c861
BIN
rtdata/sounds/Empty.wav
Normal file
BIN
rtdata/sounds/Empty.wav
Normal file
Binary file not shown.
@ -31,6 +31,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <options.h>
|
#include <options.h>
|
||||||
|
#include <soundman.h>
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@ -94,6 +95,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
Options::load ();
|
Options::load ();
|
||||||
|
|
||||||
|
SoundManager::init();
|
||||||
|
|
||||||
if (argc>1){
|
if (argc>1){
|
||||||
int ret = processLineParams( argc, argv);
|
int ret = processLineParams( argc, argv);
|
||||||
if( ret <= 0 )
|
if( ret <= 0 )
|
||||||
|
@ -147,6 +147,7 @@ void Options::setDefaults () {
|
|||||||
cutOverlayBrush = std::vector<double> (4);
|
cutOverlayBrush = std::vector<double> (4);
|
||||||
cutOverlayBrush[3] = 0.667; // :-p
|
cutOverlayBrush[3] = 0.667; // :-p
|
||||||
|
|
||||||
|
sndEnable=true;
|
||||||
sndLngEditProcDoneSecs=3.0;
|
sndLngEditProcDoneSecs=3.0;
|
||||||
|
|
||||||
int babehav[] = {
|
int babehav[] = {
|
||||||
@ -389,6 +390,7 @@ if (keyFile.has_group ("Batch Processing")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (keyFile.has_group ("Sounds")) {
|
if (keyFile.has_group ("Sounds")) {
|
||||||
|
if (keyFile.has_key ("Sounds", "Enable")) sndEnable = keyFile.get_boolean ("Sounds", "Enable");
|
||||||
if (keyFile.has_key ("Sounds", "BatchQueueDone")) sndBatchQueueDone = keyFile.get_string ("Sounds", "BatchQueueDone");
|
if (keyFile.has_key ("Sounds", "BatchQueueDone")) sndBatchQueueDone = keyFile.get_string ("Sounds", "BatchQueueDone");
|
||||||
if (keyFile.has_key ("Sounds", "LngEditProcDone")) sndLngEditProcDone = keyFile.get_string ("Sounds", "LngEditProcDone");
|
if (keyFile.has_key ("Sounds", "LngEditProcDone")) sndLngEditProcDone = keyFile.get_string ("Sounds", "LngEditProcDone");
|
||||||
if (keyFile.has_key ("Sounds", "LngEditProcDoneSecs")) sndLngEditProcDoneSecs = keyFile.get_double ("Sounds", "LngEditProcDoneSecs");
|
if (keyFile.has_key ("Sounds", "LngEditProcDoneSecs")) sndLngEditProcDoneSecs = keyFile.get_double ("Sounds", "LngEditProcDoneSecs");
|
||||||
@ -543,6 +545,7 @@ int Options::saveToFile (Glib::ustring fname) {
|
|||||||
Glib::ArrayHandle<int> bab = baBehav;
|
Glib::ArrayHandle<int> bab = baBehav;
|
||||||
keyFile.set_integer_list ("Batch Processing", "AdjusterBehavior", bab);
|
keyFile.set_integer_list ("Batch Processing", "AdjusterBehavior", bab);
|
||||||
|
|
||||||
|
keyFile.set_boolean ("Sounds", "Enable", sndEnable);
|
||||||
keyFile.set_string ("Sounds", "BatchQueueDone", sndBatchQueueDone);
|
keyFile.set_string ("Sounds", "BatchQueueDone", sndBatchQueueDone);
|
||||||
keyFile.set_string ("Sounds", "LngEditProcDone", sndLngEditProcDone);
|
keyFile.set_string ("Sounds", "LngEditProcDone", sndLngEditProcDone);
|
||||||
keyFile.set_double ("Sounds", "LngEditProcDoneSecs", sndLngEditProcDoneSecs);
|
keyFile.set_double ("Sounds", "LngEditProcDoneSecs", sndLngEditProcDoneSecs);
|
||||||
|
@ -143,6 +143,8 @@ class Options {
|
|||||||
Glib::ustring sndBatchQueueDone;
|
Glib::ustring sndBatchQueueDone;
|
||||||
Glib::ustring sndLngEditProcDone;
|
Glib::ustring sndLngEditProcDone;
|
||||||
double sndLngEditProcDoneSecs; // Minimum processing time seconds till the sound is played
|
double sndLngEditProcDoneSecs; // Minimum processing time seconds till the sound is played
|
||||||
|
bool sndEnable;
|
||||||
|
|
||||||
bool tunnelMetaData; // Pass through IPTC and XMP unchanged
|
bool tunnelMetaData; // Pass through IPTC and XMP unchanged
|
||||||
int histogramPosition; // 0=disabled, 1=left pane, 2=right pane
|
int histogramPosition; // 0=disabled, 1=left pane, 2=right pane
|
||||||
bool showProfileSelector;
|
bool showProfileSelector;
|
||||||
|
@ -396,6 +396,8 @@ Gtk::Widget* Preferences::getColorManagementPanel () {
|
|||||||
colt->attach (*cbAutoMonProfile, 1, 2, 3, 4, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2);
|
colt->attach (*cbAutoMonProfile, 1, 2, 3, 4, Gtk::EXPAND | Gtk::FILL | Gtk::SHRINK, Gtk::SHRINK, 2, 2);
|
||||||
mvbcm->pack_start (*colt, Gtk::PACK_SHRINK, 4);
|
mvbcm->pack_start (*colt, Gtk::PACK_SHRINK, 4);
|
||||||
|
|
||||||
|
autoMonProfileToggled();
|
||||||
|
|
||||||
return mvbcm;
|
return mvbcm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,6 +837,11 @@ Gtk::Widget* Preferences::getFileBrowserPanel () {
|
|||||||
Gtk::Widget* Preferences::getSoundPanel () {
|
Gtk::Widget* Preferences::getSoundPanel () {
|
||||||
Gtk::VBox* pSnd = new Gtk::VBox ();
|
Gtk::VBox* pSnd = new Gtk::VBox ();
|
||||||
|
|
||||||
|
ckbSndEnable = Gtk::manage( new Gtk::CheckButton (M("GENERAL_ENABLE")));
|
||||||
|
sndEnableConn = ckbSndEnable->signal_toggled().connect (sigc::mem_fun(*this, &Preferences::sndEnableToggled));
|
||||||
|
|
||||||
|
pSnd->pack_start (*ckbSndEnable, Gtk::PACK_SHRINK, 8);
|
||||||
|
|
||||||
Gtk::Label* lSndHelp = Gtk::manage (new Gtk::Label (M("PREFERENCES_SND_HELP")));
|
Gtk::Label* lSndHelp = Gtk::manage (new Gtk::Label (M("PREFERENCES_SND_HELP")));
|
||||||
pSnd->pack_start (*lSndHelp, Gtk::PACK_SHRINK, 4);
|
pSnd->pack_start (*lSndHelp, Gtk::PACK_SHRINK, 4);
|
||||||
|
|
||||||
@ -871,6 +878,8 @@ Gtk::Widget* Preferences::getSoundPanel () {
|
|||||||
|
|
||||||
pSnd->set_border_width (4);
|
pSnd->set_border_width (4);
|
||||||
|
|
||||||
|
sndEnableToggled();
|
||||||
|
|
||||||
return pSnd;
|
return pSnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1003,6 +1012,7 @@ void Preferences::storePreferences () {
|
|||||||
moptions.overwriteOutputFile = chOverwriteOutputFile->get_active ();
|
moptions.overwriteOutputFile = chOverwriteOutputFile->get_active ();
|
||||||
|
|
||||||
// Sounds
|
// Sounds
|
||||||
|
moptions.sndEnable = ckbSndEnable->get_active ();
|
||||||
moptions.sndBatchQueueDone = txtSndBatchQueueDone->get_text ();
|
moptions.sndBatchQueueDone = txtSndBatchQueueDone->get_text ();
|
||||||
moptions.sndLngEditProcDone = txtSndLngEditProcDone->get_text ();
|
moptions.sndLngEditProcDone = txtSndLngEditProcDone->get_text ();
|
||||||
moptions.sndLngEditProcDoneSecs = spbSndLngEditProcDoneSecs->get_value ();
|
moptions.sndLngEditProcDoneSecs = spbSndLngEditProcDoneSecs->get_value ();
|
||||||
@ -1142,6 +1152,7 @@ void Preferences::fillPreferences () {
|
|||||||
chOverwriteOutputFile->set_active (moptions.overwriteOutputFile);
|
chOverwriteOutputFile->set_active (moptions.overwriteOutputFile);
|
||||||
|
|
||||||
// Sounds
|
// Sounds
|
||||||
|
ckbSndEnable->set_active (moptions.sndEnable);
|
||||||
txtSndBatchQueueDone->set_text (moptions.sndBatchQueueDone);
|
txtSndBatchQueueDone->set_text (moptions.sndBatchQueueDone);
|
||||||
txtSndLngEditProcDone->set_text (moptions.sndLngEditProcDone);
|
txtSndLngEditProcDone->set_text (moptions.sndLngEditProcDone);
|
||||||
spbSndLngEditProcDoneSecs->set_value (moptions.sndLngEditProcDoneSecs);
|
spbSndLngEditProcDoneSecs->set_value (moptions.sndLngEditProcDoneSecs);
|
||||||
@ -1166,6 +1177,13 @@ void Preferences::autoMonProfileToggled () {
|
|||||||
monProfile->set_sensitive(!cbAutoMonProfile->get_active());
|
monProfile->set_sensitive(!cbAutoMonProfile->get_active());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preferences::sndEnableToggled () {
|
||||||
|
txtSndBatchQueueDone->set_sensitive(ckbSndEnable->get_active());
|
||||||
|
txtSndLngEditProcDone->set_sensitive(ckbSndEnable->get_active());
|
||||||
|
spbSndLngEditProcDoneSecs->set_sensitive(ckbSndEnable->get_active());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Preferences::okPressed () {
|
void Preferences::okPressed () {
|
||||||
|
|
||||||
storePreferences ();
|
storePreferences ();
|
||||||
|
@ -116,6 +116,7 @@ class Preferences : public Gtk::Dialog {
|
|||||||
Gtk::ComboBoxText* editorLayout;
|
Gtk::ComboBoxText* editorLayout;
|
||||||
RTWindow* parent;
|
RTWindow* parent;
|
||||||
|
|
||||||
|
Gtk::CheckButton* ckbSndEnable;
|
||||||
Gtk::Entry* txtSndBatchQueueDone;
|
Gtk::Entry* txtSndBatchQueueDone;
|
||||||
Gtk::Entry* txtSndLngEditProcDone;
|
Gtk::Entry* txtSndLngEditProcDone;
|
||||||
Gtk::SpinButton* spbSndLngEditProcDoneSecs;
|
Gtk::SpinButton* spbSndLngEditProcDoneSecs;
|
||||||
@ -131,7 +132,7 @@ class Preferences : public Gtk::Dialog {
|
|||||||
|
|
||||||
|
|
||||||
Options moptions;
|
Options moptions;
|
||||||
sigc::connection tconn, sconn, fconn, usethcon, addc, setc, dfconn, ffconn, autoMonProfileConn;
|
sigc::connection tconn, sconn, fconn, usethcon, addc, setc, dfconn, ffconn, autoMonProfileConn, sndEnableConn;
|
||||||
Glib::ustring initialTheme;
|
Glib::ustring initialTheme;
|
||||||
Glib::ustring initialFont;
|
Glib::ustring initialFont;
|
||||||
|
|
||||||
@ -170,6 +171,7 @@ class Preferences : public Gtk::Dialog {
|
|||||||
void cancelPressed ();
|
void cancelPressed ();
|
||||||
void aboutPressed ();
|
void aboutPressed ();
|
||||||
void autoMonProfileToggled ();
|
void autoMonProfileToggled ();
|
||||||
|
void sndEnableToggled ();
|
||||||
|
|
||||||
void selectStartupDir ();
|
void selectStartupDir ();
|
||||||
void addExtPressed ();
|
void addExtPressed ();
|
||||||
|
@ -19,23 +19,33 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <soundman.h>
|
#include <soundman.h>
|
||||||
|
#include <options.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void SoundManager::init()
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
// TODO: On Windows Vista/7 RT should register with the OS sound system, so it can enjoy application specific
|
// TODO: On Windows Vista/7 RT should register with the OS sound system, so it can enjoy application specific
|
||||||
// volume, safed, process independent etc. from the start.
|
// volume, safed, process independent etc. from the start.
|
||||||
// Function call is IAudioClient::Initialize
|
// Function call is IAudioClient::Initialize
|
||||||
// Unfortunately MinGW does not support this yet. If audioclient.h is available, add an Init
|
// Unfortunately MinGW does not support this yet. If audioclient.h is available, add an Init
|
||||||
// called once on program start.
|
// called once on program start.
|
||||||
|
//
|
||||||
|
// This mitigation plays an empty file on start, so RT is immidiately avaible in the Windows mixer at least
|
||||||
|
playSoundAsync(Glib::ustring("sounds\\Empty.wav"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Plays a sound in async mode to not block the main thread
|
// Plays a sound in async mode to not block the main thread
|
||||||
// param is either file name or name of the system event on Windows (e.g. "SystemAsterisk" or "SystemDefault").
|
// param is either file name or name of the system event on Windows (e.g. "SystemAsterisk" or "SystemDefault").
|
||||||
void SoundManager::playSoundAsync(const Glib::ustring &sound)
|
void SoundManager::playSoundAsync(const Glib::ustring &sound)
|
||||||
{
|
{
|
||||||
if (sound.empty()) return;
|
if (sound.empty() || !options.sndEnable) return;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
DWORD sndParam=SND_ASYNC | SND_NODEFAULT;
|
DWORD sndParam=SND_ASYNC | SND_NODEFAULT;
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
class SoundManager {
|
class SoundManager {
|
||||||
public:
|
public:
|
||||||
|
static void init();
|
||||||
static void playSoundAsync(const Glib::ustring &sound);
|
static void playSoundAsync(const Glib::ustring &sound);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user