Browse files

Added: Text displaying on playback start, end, stop, pause and on XBM…

…C connection is taken from the settings now.

Updated: XBMCJsonRpcSharp.dll to v0.1.0.4-rls.
  • Loading branch information...
1 parent cea678a commit e40a3b212edfff397df45f24a94662c449d8b113 @margru committed Jan 17, 2012
View
14 Properties/Settings.Designer.cs
@@ -650,7 +650,7 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("1000")]
+ [global::System.Configuration.DefaultSettingValueAttribute("0")]
public int XbmcOnEventTextDelayMS {
get {
return ((int)(this["XbmcOnEventTextDelayMS"]));
@@ -659,5 +659,17 @@ internal sealed partial class Settings : global::System.Configuration.Applicatio
this["XbmcOnEventTextDelayMS"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Connected")]
+ public string XbmcOnConnectedText {
+ get {
+ return ((string)(this["XbmcOnConnectedText"]));
+ }
+ set {
+ this["XbmcOnConnectedText"] = value;
+ }
+ }
}
}
View
5 Properties/Settings.settings
@@ -159,7 +159,10 @@
<Value Profile="(Default)">END</Value>
</Setting>
<Setting Name="XbmcOnEventTextDelayMS" Type="System.Int32" Scope="User">
- <Value Profile="(Default)">1000</Value>
+ <Value Profile="(Default)">0</Value>
+ </Setting>
+ <Setting Name="XbmcOnConnectedText" Type="System.String" Scope="User">
+ <Value Profile="(Default)">Connected</Value>
</Setting>
</Settings>
</SettingsFile>
View
57 XbmcHandler.cs
@@ -90,7 +90,7 @@ public XbmcHandler(XbmcJsonRpcConnection xbmc, DisplayHandler display)
this.xbmc.Aborted += this.xbmcAborted;
this.xbmc.Player.PlaybackStarted += this.xbmcPlaybackStarted;
this.xbmc.Player.PlaybackPaused += this.xbmcPlaybackPaused;
- this.xbmc.Player.PlaybackResumed += this.xbmcPlaybackResumed;
+ //this.xbmc.Player.PlaybackResumed += this.xbmcPlaybackResumed;
this.xbmc.Player.PlaybackStopped += this.xbmcPlaybackStopped;
this.xbmc.Player.PlaybackEnded += this.xbmcPlaybackEnded;
this.xbmc.Player.PlaybackSeek += this.xbmcPlaybackSeek;
@@ -193,7 +193,7 @@ protected override void OnDoWork(DoWorkEventArgs e)
this.xbmc.Player.PlaybackStarted -= this.xbmcPlaybackStarted;
this.xbmc.Player.PlaybackPaused -= this.xbmcPlaybackPaused;
- this.xbmc.Player.PlaybackResumed -= this.xbmcPlaybackResumed;
+ //this.xbmc.Player.PlaybackResumed -= this.xbmcPlaybackResumed;
this.xbmc.Player.PlaybackStopped -= this.xbmcPlaybackStopped;
this.xbmc.Player.PlaybackEnded -= this.xbmcPlaybackEnded;
this.xbmc.Player.PlaybackSeek -= this.xbmcPlaybackSeek;
@@ -257,6 +257,11 @@ private void xbmcConnected(object sender, EventArgs e)
Logging.Error("XBMC", "Could not get current time", ex);
}
+ if (Settings.Default.XbmcOnConnectedText.CompareTo("") != 0)
+ {
+ this.display.SetText(Settings.Default.XbmcOnConnectedText, Settings.Default.XbmcOnEventTextDelayMS);
+ }
+
this.update();
}
@@ -287,6 +292,11 @@ private void xbmcPlaybackStarted(object sender, XbmcPlayerPlaybackChangedEventAr
Logging.Log(LoggingArea, "Position " + this.position.TotalSeconds + " of " + this.length.TotalSeconds + " [s]");
this.progressTimer.Start();
+ if (Settings.Default.XbmcOnPlayText.CompareTo("") != 0)
+ {
+ this.display.SetText(Settings.Default.XbmcOnPlayText, Settings.Default.XbmcOnEventTextDelayMS);
+ }
+
this.update();
}
@@ -305,35 +315,42 @@ private void xbmcPlaybackPaused(object sender, XbmcPlayerPlaybackPositionChanged
this.position = e.Position;
this.updateProgress();
- this.display.SetText("Pause", "Pause", e.Position.ToString());
+ if (Settings.Default.XbmcOnPauseText.CompareTo("") != 0)
+ {
+ this.display.SetText(Settings.Default.XbmcOnPauseText, Settings.Default.XbmcOnPauseText, e.Position.ToString(), Settings.Default.XbmcOnEventTextDelayMS);
+ }
this.update();
}
- private void xbmcPlaybackResumed(object sender, XbmcPlayerPlaybackPositionChangedEventArgs e)
- {
- if (e == null || e.Player == null)
- {
- return;
- }
+ //private void xbmcPlaybackResumed(object sender, XbmcPlayerPlaybackPositionChangedEventArgs e)
+ //{
+ // if (e == null || e.Player == null)
+ // {
+ // return;
+ // }
- Logging.Log(LoggingArea, "Playback resumed");
+ // Logging.Log(LoggingArea, "Playback resumed");
- this.playerState = PlayerState.Playing;
+ // this.playerState = PlayerState.Playing;
- this.position = e.Position;
- this.updateProgress();
- this.progressTimer.Start();
+ // this.position = e.Position;
+ // this.updateProgress();
+ // this.progressTimer.Start();
- this.update();
- }
+ // this.update();
+ //}
private void xbmcPlaybackStopped(object sender, EventArgs e)
{
Logging.Log(LoggingArea, "Playback stopped");
this.playbackStopped();
- this.display.SetText("STOP", "Playback", "stopped", DefaultTextDelay);
+ if (Settings.Default.XbmcOnStopText.CompareTo("") != 0)
+ {
+ this.display.SetText(Settings.Default.XbmcOnStopText, Settings.Default.XbmcOnEventTextDelayMS);
+ }
+ //this.display.SetText("STOP", "Playback", "stopped", DefaultTextDelay);
this.update();
}
@@ -343,7 +360,11 @@ private void xbmcPlaybackEnded(object sender, EventArgs e)
Logging.Log(LoggingArea, "Playback ended");
this.playbackStopped();
- this.display.SetText("Playback ended", "Playback", "ended", DefaultTextDelay);
+ if (Settings.Default.XbmcOnEndText.CompareTo("") != 0)
+ {
+ this.display.SetText(Settings.Default.XbmcOnEndText, Settings.Default.XbmcOnEventTextDelayMS);
+ }
+ //this.display.SetText("Playback ended", "Playback", "ended", DefaultTextDelay);
this.update();
}
View
5 app.config
@@ -179,7 +179,10 @@
<value>END</value>
</setting>
<setting name="XbmcOnEventTextDelayMS" serializeAs="String">
- <value>1000</value>
+ <value>0</value>
+ </setting>
+ <setting name="XbmcOnConnectedText" serializeAs="String">
+ <value>Connected</value>
</setting>
</iMon.XBMC.Properties.Settings>
</userSettings>
View
BIN lib/XbmcJsonRpcSharp/XBMCJsonRpcSharp.dll
Binary file not shown.
View
BIN lib/iMonDisplayApiWrapperSharp/iMonDisplayApiSharp.dll
Binary file not shown.
View
BIN lib/iMonDisplayApiWrapperSharp/iMonDisplayApiWrapperSharp.dll
Binary file not shown.

0 comments on commit e40a3b2

Please sign in to comment.