X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FDemoRecorder.vala;h=5af0fb9c325d6b41feee9474243086d09221a174;hb=ed4d7293613de156acc26d0821b438658b56e52a;hp=d0172da5111c12a72272e3b38c5bcbefbd9a09f7;hpb=804630a4e0d41b182d8540f2aec69cf25ca0acfd;p=demorecorder 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 = "";