~cszikszoy/do-plugins/pastebin

« back to all changes in this revision

Viewing changes to Rhythmbox/src/RhythmboxItems.cs

  • Committer: djsiegel at gmail
  • Date: 2007-11-07 17:13:21 UTC
  • Revision ID: djsiegel@gmail.com-20071107171321-zgu46ukqlpdx1ypa
Initial files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  RhythmboxItems.cs
 
2
//
 
3
//  GNOME Do is the legal property of its developers, whose names are too numerous
 
4
//  to list here.  Please refer to the COPYRIGHT file distributed with this
 
5
//  source distribution.
 
6
//
 
7
//  This program is free software: you can redistribute it and/or modify
 
8
//  it under the terms of the GNU General Public License as published by
 
9
//  the Free Software Foundation, either version 3 of the License, or
 
10
//  (at your option) any later version.
 
11
//
 
12
//  This program is distributed in the hope that it will be useful,
 
13
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
//  GNU General Public License for more details.
 
16
//
 
17
//  You should have received a copy of the GNU General Public License
 
18
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 
 
20
using System;
 
21
using System.Threading;
 
22
using System.Diagnostics;
 
23
 
 
24
using Do.Addins;
 
25
using RhythmboxAddin;
 
26
 
 
27
namespace Do.Universe
 
28
{
 
29
        
 
30
        
 
31
        public class RhythmboxRunnableItem : IRunnableItem
 
32
        {
 
33
                public static readonly RhythmboxRunnableItem[] DefaultItems =
 
34
                  new RhythmboxRunnableItem[] {
 
35
                        
 
36
                        new RhythmboxRunnableItem ("Play",
 
37
                                               "Play Current Track in Rhythmbox",
 
38
                                                   "player_play",
 
39
                                                   "--play"),
 
40
                        
 
41
                        new RhythmboxRunnableItem ("Pause",
 
42
                                                   "Pause Rhythmbox Playback",
 
43
                                                   "player_pause",
 
44
                                                   "--play-pause"),
 
45
                        
 
46
                        new RhythmboxRunnableItem ("Next",
 
47
                                                   "Play Next Track in Rhythmbox",
 
48
                                                   "player_end",
 
49
                                                   "--next"),
 
50
                        
 
51
                        new RhythmboxRunnableItem ("Previous",
 
52
                                                   "Play Previous Track in Rhythmbox",
 
53
                                                   "player_start",
 
54
                                                   "--previous"),
 
55
                        
 
56
                        new RhythmboxRunnableItem ("Show Current Track",
 
57
                                                   "Show Notification of Current Track in Rhythmbox",
 
58
                                                   "gnome-mime-audio",
 
59
                                                   "--notify"),
 
60
                        
 
61
                        new RhythmboxRunnableItem ("Mute",
 
62
                                                   "Mute Rhythmbox Playback",
 
63
                                                   "audio-volume-muted",
 
64
                                                   "--mute"),
 
65
                        
 
66
                        new RhythmboxRunnableItem ("Unmute",
 
67
                                                   "Unmute Rhythmbox Playback",
 
68
                                                   "audio-volume-high",
 
69
                                                   "--unmute"),
 
70
                        
 
71
                        new RhythmboxRunnableItem ("Volume Up",
 
72
                                                   "Increase Rhythmbox Playback Volume",
 
73
                                                   "audio-volume-high",
 
74
                                                   "--volume-up"),
 
75
                        
 
76
                        new RhythmboxRunnableItem ("Volume Down",
 
77
                                                   "Decrease Rhythmbox Playback Volume",
 
78
                                                   "audio-volume-low",
 
79
                                                   "--volume-down"),
 
80
                };
 
81
                
 
82
                string name, description, icon, command;
 
83
                
 
84
                public RhythmboxRunnableItem (string name, string description, string icon, string command)
 
85
                {
 
86
                        this.name = name;
 
87
                        this.description = description;
 
88
                        this.icon = icon;
 
89
                        this.command = command;
 
90
                }
 
91
                
 
92
                public string Name { get { return name; } }
 
93
                public string Description { get { return description; } }
 
94
                public string Icon { get { return icon; } }
 
95
                
 
96
                public void Run ()
 
97
                {
 
98
                        new Thread ((ThreadStart) delegate {
 
99
                                Rhythmbox.StartIfNeccessary ();
 
100
                                Rhythmbox.Client (command);
 
101
                        }).Start ();
 
102
                }
 
103
                
 
104
        }
 
105
}