[rygel/config] Config UI loads/saves the transcoding options



commit 1c82936b2aa00ee89e4d0af6d9222adf6a499f17
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Apr 28 23:59:13 2009 +0300

    Config UI loads/saves the transcoding options
---
 src/ui/rygel-general-pref-page.vala |   36 +++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/src/ui/rygel-general-pref-page.vala b/src/ui/rygel-general-pref-page.vala
index 9ee10e0..551fb22 100644
--- a/src/ui/rygel-general-pref-page.vala
+++ b/src/ui/rygel-general-pref-page.vala
@@ -25,10 +25,20 @@ using Gtk;
 public class Rygel.GeneralPrefPage : PreferencesPage {
     const string IP_ENTRY = "ip-entry";
     const string PORT_SPINBUTTON = "port-spinbutton";
+    const string TRANS_CHECKBUTTON = "transcoding-checkbutton";
+    const string MP3_CHECKBUTTON = "mp3-checkbutton";
+    const string MP2TS_CHECKBUTTON = "mp2ts-checkbutton";
+    const string LPCM_CHECKBUTTON = "lpcm-checkbutton";
 
     private Entry ip_entry;
     private SpinButton port_spin;
 
+    // Transcoding options
+    private CheckButton trans_check;
+    private CheckButton mp3_check;
+    private CheckButton mp2ts_check;
+    private CheckButton lpcm_check;
+
     public GeneralPrefPage (Builder       builder,
                             Configuration config) throws Error {
         base (config, "general");
@@ -37,11 +47,24 @@ public class Rygel.GeneralPrefPage : PreferencesPage {
         assert (this.ip_entry != null);
         this.port_spin = (SpinButton) builder.get_object (PORT_SPINBUTTON);
         assert (this.port_spin != null);
+        this.trans_check = (CheckButton) builder.get_object (TRANS_CHECKBUTTON);
+        assert (this.trans_check != null);
+        this.mp3_check = (CheckButton) builder.get_object (MP3_CHECKBUTTON);
+        assert (this.mp3_check != null);
+        this.mp2ts_check = (CheckButton) builder.get_object (MP2TS_CHECKBUTTON);
+        assert (this.mp2ts_check != null);
+        this.lpcm_check = (CheckButton) builder.get_object (LPCM_CHECKBUTTON);
+        assert (this.lpcm_check != null);
 
         if (config.host_ip != null) {
             this.ip_entry.set_text (config.host_ip);
         }
         this.port_spin.set_value (config.port);
+
+        this.trans_check.active = this.config.transcoding;
+        this.mp3_check.active = this.config.mp3_transcoder;
+        this.mp2ts_check.active = this.config.mp2ts_transcoder;
+        this.lpcm_check.active = this.config.lpcm_transcoder;
     }
 
     public override void save () {
@@ -52,5 +75,18 @@ public class Rygel.GeneralPrefPage : PreferencesPage {
         this.config.set_int (this.section,
                              Configuration.PORT_KEY,
                              (int) this.port_spin.get_value ());
+
+        this.config.set_bool (this.section,
+                              Configuration.TRANSCODING_KEY,
+                              this.trans_check.active);
+        this.config.set_bool (this.section,
+                              Configuration.MP3_TRANSCODER_KEY,
+                              this.mp3_check.active);
+        this.config.set_bool (this.section,
+                              Configuration.MP2TS_TRANSCODER_KEY,
+                              this.mp2ts_check.active);
+        this.config.set_bool (this.section,
+                              Configuration.LPCM_TRANSCODER_KEY,
+                              this.lpcm_check.active);
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]