Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / playbackconfig.C
index 22fee714ef0675a3c74cba4585ecd1195cca4b24..6d502ee6b71b970d1f4cd39d47db15ceae5fd898 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * CINELERRA
  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2003-2016 Cinelerra CV contributors
  *
  * 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
@@ -30,10 +31,13 @@ AudioOutConfig::AudioOutConfig()
        fragment_size = 16384;
 #ifdef HAVE_ALSA
        driver = AUDIO_ALSA;
+#else
+#ifdef HAVE_PULSE
+       driver = AUDIO_PULSE;
 #else
        driver = AUDIO_OSS;
 #endif
-
+#endif
        audio_offset = 0.0;
        map51_2 = 0;
        play_gain = 1.0;
@@ -48,6 +52,8 @@ AudioOutConfig::AudioOutConfig()
        esound_out_server[0] = 0;
        esound_out_port = 0;
 
+       pulse_out_server[0] = 0;
+
        sprintf(alsa_out_device, "default");
        alsa_out_bits = 16;
        interrupt_workaround = 0;
@@ -85,12 +91,10 @@ int AudioOutConfig::operator==(AudioOutConfig &that)
                !strcmp(oss_out_device[0], that.oss_out_device[0]) &&
                (oss_out_bits == that.oss_out_bits) &&
 
-
-
                !strcmp(esound_out_server, that.esound_out_server) &&
                (esound_out_port == that.esound_out_port) &&
 
-
+               !strcmp(pulse_out_server, that.pulse_out_server) &&
 
                !strcmp(alsa_out_device, that.alsa_out_device) &&
                (alsa_out_bits == that.alsa_out_bits) &&
@@ -126,6 +130,9 @@ void AudioOutConfig::copy_from(AudioOutConfig *src)
 
        strcpy(esound_out_server, src->esound_out_server);
        esound_out_port = src->esound_out_port;
+
+       strcpy(pulse_out_server, src->pulse_out_server);
+
        for(int i = 0; i < MAXDEVICES; i++)
        {
                oss_enable[i] = src->oss_enable[i];
@@ -171,8 +178,11 @@ int AudioOutConfig::load_defaults(BC_Hash *defaults, int active_config)
        interrupt_workaround = defaults->getf(interrupt_workaround, "%sALSA_INTERRUPT_WORKAROUND", prefix);
 
        defaults->getf(esound_out_server, "%sESOUND_OUT_SERVER", prefix);
+       defaults->getf(pulse_out_server, "%sPULSE_OUT_SERVER", prefix);
        esound_out_port = defaults->getf(esound_out_port, "%sESOUND_OUT_PORT", prefix);
 
+       defaults->getf(pulse_out_server, "%sPULSE_OUT_SERVER", prefix);
+
        firewire_channel = defaults->getf(firewire_channel, "%sAFIREWIRE_OUT_CHANNEL", prefix);
        firewire_port = defaults->getf(firewire_port, "%sAFIREWIRE_OUT_PORT", prefix);
        defaults->getf(firewire_path, "%sAFIREWIRE_OUT_PATH", prefix);
@@ -211,8 +221,11 @@ int AudioOutConfig::save_defaults(BC_Hash *defaults, int active_config)
        defaults->updatef(interrupt_workaround, "%sALSA_INTERRUPT_WORKAROUND", prefix);
 
        defaults->updatef(esound_out_server, "%sESOUND_OUT_SERVER", prefix);
+       defaults->updatef(pulse_out_server, "%sPULSE_OUT_SERVER", prefix);
        defaults->updatef(esound_out_port, "%sESOUND_OUT_PORT", prefix);
 
+       defaults->updatef(pulse_out_server, "%sPULSE_OUT_SERVER", prefix);
+
        defaults->updatef(firewire_channel, "%sAFIREWIRE_OUT_CHANNEL", prefix);
        defaults->updatef(firewire_port, "%sAFIREWIRE_OUT_PORT", prefix);
        defaults->updatef(firewire_path, "%sAFIREWIRE_OUT_PATH", prefix);