[longomatch] Rename 'toggle_pause' to 'pause' isnce there is no toggling.
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Rename 'toggle_pause' to 'pause' isnce there is no toggling.
- Date: Tue, 6 Apr 2010 00:27:36 +0000 (UTC)
commit 9deead338978ed699489a5d08d26279746589446
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Apr 5 17:07:03 2010 +0200
Rename 'toggle_pause' to 'pause' isnce there is no toggling.
CesarPlayer/Capturer/FakeCapturer.cs | 15 ++-------
CesarPlayer/Capturer/GstCameraCapturer.cs | 6 ++--
CesarPlayer/Capturer/ICapturer.cs | 2 +-
CesarPlayer/Gui/CapturerBin.cs | 33 ++++++++++++++------
CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs | 36 +++++++++++-----------
LongoMatch/Gui/MainWindow.cs | 2 +-
LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs | 2 +-
libcesarplayer/src/gst-camera-capturer.c | 2 +-
libcesarplayer/src/gst-camera-capturer.h | 2 +-
9 files changed, 52 insertions(+), 48 deletions(-)
---
diff --git a/CesarPlayer/Capturer/FakeCapturer.cs b/CesarPlayer/Capturer/FakeCapturer.cs
index a453ffa..cf83704 100644
--- a/CesarPlayer/Capturer/FakeCapturer.cs
+++ b/CesarPlayer/Capturer/FakeCapturer.cs
@@ -54,18 +54,9 @@ namespace LongoMatch.Video.Capturer
}
}
- public void TogglePause(){
- if (!started)
- return;
-
- if (playing){
- playing = false;
- ellapsed += DateTime.Now - lastStart;
- }
- else{
- playing = true;
- lastStart = DateTime.Now;
- }
+ public void Pause(){
+ playing = false;
+ ellapsed += DateTime.Now - lastStart;
}
public void Start(){
diff --git a/CesarPlayer/Capturer/GstCameraCapturer.cs b/CesarPlayer/Capturer/GstCameraCapturer.cs
index 7b4d9ac..a6d1b47 100644
--- a/CesarPlayer/Capturer/GstCameraCapturer.cs
+++ b/CesarPlayer/Capturer/GstCameraCapturer.cs
@@ -273,10 +273,10 @@ namespace LongoMatch.Video.Capturer {
[DllImport("libcesarplayer.dll")]
- static extern void gst_camera_capturer_toggle_pause(IntPtr raw);
+ static extern void gst_camera_capturer_pause(IntPtr raw);
- public void TogglePause() {
- gst_camera_capturer_toggle_pause(Handle);
+ public void Pause() {
+ gst_camera_capturer_pause(Handle);
}
[DllImport("libcesarplayer.dll")]
diff --git a/CesarPlayer/Capturer/ICapturer.cs b/CesarPlayer/Capturer/ICapturer.cs
index 86ee6eb..a357064 100644
--- a/CesarPlayer/Capturer/ICapturer.cs
+++ b/CesarPlayer/Capturer/ICapturer.cs
@@ -64,7 +64,7 @@ namespace LongoMatch.Video.Capturer
bool SetVideoMuxer(LongoMatch.Video.Capturer.GccVideoMuxerType type);
- void TogglePause();
+ void Pause();
void Start();
diff --git a/CesarPlayer/Gui/CapturerBin.cs b/CesarPlayer/Gui/CapturerBin.cs
index 420b902..fceaa08 100644
--- a/CesarPlayer/Gui/CapturerBin.cs
+++ b/CesarPlayer/Gui/CapturerBin.cs
@@ -40,11 +40,12 @@ namespace LongoMatch.Gui
private Pixbuf logopix;
ICapturer capturer;
+ bool capturing;
public CapturerBin()
{
this.Build();
- Type = CapturerType.FAKE;
+ Type = CapturerType.FAKE;
}
public CapturerType Type {
@@ -64,6 +65,7 @@ namespace LongoMatch.Gui
else{
capturerhbox.Visible = false;
}
+ capturing = false;
}
}
@@ -96,16 +98,32 @@ namespace LongoMatch.Gui
return capturer.CurrentTime;
}
}
- public void TogglePause(){
- capturer.TogglePause();
+
+ public void ToggleCapture(){
+ if (capturing)
+ Pause();
+ else
+ Start();
+ }
+
+ public void Pause(){
+ recbutton.Visible = true;
+ pausebutton.Visible = false;
+ capturer.Pause();
+ capturing = false;
}
public void Start(){
+ recbutton.Visible = false;
+ pausebutton.Visible = true;
+ stopbutton.Visible = true;
capturer.Start();
+ capturing = true;
}
public void Stop(){
capturer.Stop();
+ capturing = false;
}
public void SetVideoEncoder(LongoMatch.Video.Capturer.GccVideoEncoderType type){
@@ -122,17 +140,12 @@ namespace LongoMatch.Gui
protected virtual void OnRecbuttonClicked (object sender, System.EventArgs e)
{
- Start();
- recbutton.Visible = false;
- pausebutton.Visible = true;
- stopbutton.Visible = true;
+ Start();
}
protected virtual void OnPausebuttonClicked (object sender, System.EventArgs e)
{
- TogglePause();
- recbutton.Visible = true;
- pausebutton.Visible = false;
+ Pause();
}
protected virtual void OnStopbuttonClicked (object sender, System.EventArgs e)
diff --git a/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs b/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs
index b47308e..dc020ca 100644
--- a/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs
+++ b/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs
@@ -106,14 +106,14 @@ namespace LongoMatch.Gui {
this.drawbutton.UseUnderline = true;
// Container child drawbutton.Gtk.Container+ContainerChild
Gtk.Alignment w11 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment1.Gtk.Container+ContainerChild
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
Gtk.HBox w12 = new Gtk.HBox();
w12.Spacing = 2;
- // Container child GtkHBox1.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w13 = new Gtk.Image();
w13.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-select-color", Gtk.IconSize.Menu, 16);
w12.Add(w13);
- // Container child GtkHBox1.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Label w15 = new Gtk.Label();
w12.Add(w15);
w11.Add(w12);
@@ -131,14 +131,14 @@ namespace LongoMatch.Gui {
this.playbutton.Relief = ((Gtk.ReliefStyle)(2));
// Container child playbutton.Gtk.Container+ContainerChild
Gtk.Alignment w20 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment2.Gtk.Container+ContainerChild
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
Gtk.HBox w21 = new Gtk.HBox();
w21.Spacing = 2;
- // Container child GtkHBox2.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w22 = new Gtk.Image();
w22.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-media-play", Gtk.IconSize.Button, 20);
w21.Add(w22);
- // Container child GtkHBox2.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Label w24 = new Gtk.Label();
w21.Add(w24);
w20.Add(w21);
@@ -156,14 +156,14 @@ namespace LongoMatch.Gui {
this.pausebutton.Relief = ((Gtk.ReliefStyle)(2));
// Container child pausebutton.Gtk.Container+ContainerChild
Gtk.Alignment w29 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment3.Gtk.Container+ContainerChild
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
Gtk.HBox w30 = new Gtk.HBox();
w30.Spacing = 2;
- // Container child GtkHBox3.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w31 = new Gtk.Image();
w31.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-media-pause", Gtk.IconSize.Button, 20);
w30.Add(w31);
- // Container child GtkHBox3.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Label w33 = new Gtk.Label();
w30.Add(w33);
w29.Add(w30);
@@ -181,14 +181,14 @@ namespace LongoMatch.Gui {
this.prevbutton.Relief = ((Gtk.ReliefStyle)(2));
// Container child prevbutton.Gtk.Container+ContainerChild
Gtk.Alignment w38 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment4.Gtk.Container+ContainerChild
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
Gtk.HBox w39 = new Gtk.HBox();
w39.Spacing = 2;
- // Container child GtkHBox4.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w40 = new Gtk.Image();
w40.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-media-previous", Gtk.IconSize.Button, 20);
w39.Add(w40);
- // Container child GtkHBox4.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Label w42 = new Gtk.Label();
w39.Add(w42);
w38.Add(w39);
@@ -207,14 +207,14 @@ namespace LongoMatch.Gui {
this.nextbutton.Relief = ((Gtk.ReliefStyle)(2));
// Container child nextbutton.Gtk.Container+ContainerChild
Gtk.Alignment w47 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment5.Gtk.Container+ContainerChild
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
Gtk.HBox w48 = new Gtk.HBox();
w48.Spacing = 2;
- // Container child GtkHBox5.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w49 = new Gtk.Image();
w49.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-media-next", Gtk.IconSize.Button, 20);
w48.Add(w49);
- // Container child GtkHBox5.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Label w51 = new Gtk.Label();
w48.Add(w51);
w47.Add(w48);
@@ -267,14 +267,14 @@ namespace LongoMatch.Gui {
this.volumebutton.Relief = ((Gtk.ReliefStyle)(2));
// Container child volumebutton.Gtk.Container+ContainerChild
Gtk.Alignment w60 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment6.Gtk.Container+ContainerChild
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
Gtk.HBox w61 = new Gtk.HBox();
w61.Spacing = 2;
- // Container child GtkHBox6.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w62 = new Gtk.Image();
w62.Pixbuf = Stetic.IconLoader.LoadIcon(this, "stock_volume", Gtk.IconSize.Button, 20);
w61.Add(w62);
- // Container child GtkHBox6.Gtk.Container+ContainerChild
+ // Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Label w64 = new Gtk.Label();
w61.Add(w64);
w60.Add(w61);
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index 6e20d00..3962aa9 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -499,7 +499,7 @@ namespace LongoMatch.Gui
} else {
switch (key){
case Constants.TOGGLE_PLAY:
- capturerBin.TogglePause();
+ capturerBin.ToggleCapture();
break;
}
}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
index 6d24a6c..ac24646 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -193,7 +193,7 @@ namespace LongoMatch.Gui {
this.ImportProjectAction.ShortLabel = Mono.Unix.Catalog.GetString("_Import Project");
w1.Add(this.ImportProjectAction, "<Control>i");
this.FreeCaptureModeAction = new Gtk.RadioAction("FreeCaptureModeAction", Mono.Unix.Catalog.GetString("Free Capture Mode"), null, null, 0);
- this.FreeCaptureModeAction.Group = this.AnalyzeModeAction.Group;
+ this.FreeCaptureModeAction.Group = this.CaptureModeAction.Group;
this.FreeCaptureModeAction.Sensitive = false;
this.FreeCaptureModeAction.ShortLabel = Mono.Unix.Catalog.GetString("Free Capture Mode");
w1.Add(this.FreeCaptureModeAction, null);
diff --git a/libcesarplayer/src/gst-camera-capturer.c b/libcesarplayer/src/gst-camera-capturer.c
index b78d9f9..57e505d 100644
--- a/libcesarplayer/src/gst-camera-capturer.c
+++ b/libcesarplayer/src/gst-camera-capturer.c
@@ -546,7 +546,7 @@ gst_camera_capturer_start (GstCameraCapturer * gcc)
void
-gst_camera_capturer_toggle_pause (GstCameraCapturer * gcc)
+gst_camera_capturer_pause (GstCameraCapturer * gcc)
{
g_return_if_fail (GST_IS_CAMERA_CAPTURER (gcc));
g_signal_emit_by_name (G_OBJECT (gcc->priv->camerabin), "user-pause", 0, 0);
diff --git a/libcesarplayer/src/gst-camera-capturer.h b/libcesarplayer/src/gst-camera-capturer.h
index 0b2b13d..2ba0479 100644
--- a/libcesarplayer/src/gst-camera-capturer.h
+++ b/libcesarplayer/src/gst-camera-capturer.h
@@ -126,7 +126,7 @@ gst_camera_capturer_get_type (void)
GError ** err);
EXPORT void gst_camera_capturer_run (GstCameraCapturer * gcc);
EXPORT void gst_camera_capturer_start (GstCameraCapturer * gcc);
- EXPORT void gst_camera_capturer_toggle_pause (GstCameraCapturer * gcc);
+ EXPORT void gst_camera_capturer_pause (GstCameraCapturer * gcc);
EXPORT void gst_camera_capturer_stop (GstCameraCapturer * gcc);
EXPORT gboolean gst_camera_capturer_set_video_encoder (GstCameraCapturer
* gcc,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]