From ed4d7293613de156acc26d0821b438658b56e52a Mon Sep 17 00:00:00 2001 From: Dru Moore Date: Thu, 30 Sep 2010 07:58:02 +0100 Subject: [PATCH] Tidy up modified: build.sh modified: src/DemoRecorder.vala modified: src/EqualizerPreset.vala --- build.sh | 5 ++++- src/DemoRecorder.vala | 23 +++++++++++++++++++---- src/EqualizerPreset.vala | 29 ++++++++++++++--------------- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index 3273d59..86345fd 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #! /bin/bash -mkdir bin +if [ ! -d "bin" ] ; then + mkdir bin +fi #/home/druid23/MyDocs/vala/vala-0.9.4/compiler/valac \ valac \ --pkg gtk+-2.0 \ @@ -11,6 +13,7 @@ valac \ -o bin/demorecorder \ src/Program.vala \ src/DemoRecorder.vala \ +src/AboutDialog.vala \ src/ApplicationSettings.vala \ src/AcmPopUp.vala \ src/AppSettings.vala \ diff --git a/src/DemoRecorder.vala b/src/DemoRecorder.vala index d0172da..5af0fb9 100644 --- a/src/DemoRecorder.vala +++ b/src/DemoRecorder.vala @@ -152,7 +152,7 @@ public class DemoRecorder : Hildon.Program { } private bool keep_screen_on() { - if (this.recording) { + if (this.recording || this.playing) { Osso.Status status = this.osso_context.display_blanking_pause(); /*if (Osso.Status.OK == status) { stdout.printf("%s\n", "OK"); @@ -181,6 +181,9 @@ public class DemoRecorder : Hildon.Program { int idx = 0; if (0 < project.tracks.length()) { this.playing = true; + keep_screen_on(); + if (0 != screen_timer_id) Source.remove(screen_timer_id); + screen_timer_id = Timeout.add ((uint)Time.Milliseconds.SECOND * 20, keep_screen_on); // for (int i = 0; i < tracks.children.length(); ++i) { // TrackTransport tt = tracks.children.nth_data(i) as TrackTransport; // if (null != tt) { @@ -212,9 +215,11 @@ public class DemoRecorder : Hildon.Program { playback_timer_id = Timeout.add ((uint)Time.Milliseconds.SECOND / 10, update_time_and_duration_play_pipeline); } if (this.recording) { - keep_screen_on(); - if (0 != screen_timer_id) Source.remove(screen_timer_id); - screen_timer_id = Timeout.add ((uint)Time.Milliseconds.SECOND * 20, keep_screen_on); + if (!this.playing) { + keep_screen_on(); + if (0 != screen_timer_id) Source.remove(screen_timer_id); + screen_timer_id = Timeout.add ((uint)Time.Milliseconds.SECOND * 20, keep_screen_on); + } this.playback_position_duration.disconnect(player.position_duration_callback); this.recording_position_duration.connect(player.position_duration_callback); recordpipeline.position_duration.connect(recordpipeline_position_duration_callback); @@ -304,9 +309,19 @@ public class DemoRecorder : Hildon.Program { var btnSettings = new Gtk.Button.with_label("Settings"); btnSettings.clicked.connect(show_settings); menu.append(btnSettings); + var btnAbout = new Gtk.Button.with_label("About"); + btnAbout.clicked.connect(show_about); + menu.append(btnAbout); menu.show_all(); window.set_app_menu(menu); } + private void show_about() { + AboutDialog dlg = new AboutDialog(window); + dlg.set_transient_for(window); + dlg.run(); + dlg.destroy(); + dlg = null; + } private void show_settings() { File settings = File.new_for_path(Environment.get_home_dir() + "/.demorecorder/settings.xml"); string errors = ""; diff --git a/src/EqualizerPreset.vala b/src/EqualizerPreset.vala index c4bb1b8..2e2490e 100644 --- a/src/EqualizerPreset.vala +++ b/src/EqualizerPreset.vala @@ -91,24 +91,23 @@ namespace IdWorks { ); } public void from_xml_string(Xml.Node* node) {} - } - public bool deserialize_from_string(string data) { - bool good = false; - // call parser to build an array of string of parts - string[] values = CdlParser.ParseLine(data); - // check length of array - if (13 == values.length) { - // parse parts into this - name = values[0]; - for (int i = 0; i < 10; ++i) { - bands[i] = values[i + 1].to_double(); + public bool deserialize_from_string(string data) { + bool good = false; + // call parser to build an array of string of parts + string[] values = CdlParser.ParseLine(data); + // check length of array + if (13 == values.length) { + // parse parts into this + name = values[0]; + for (int i = 0; i < 10; ++i) { + bands[i] = values[i + 1].to_double(); + } + good = true; } - good = true; + return good; } - return good; + } } - -} -- 1.7.9.5