~ubuntu-branches/ubuntu/natty/orpheus/natty

« back to all changes in this revision

Viewing changes to debian/patches/patch.orpheus-1.5.add-start-stop-clear-1.diff

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2005-10-21 22:47:19 UTC
  • Revision ID: james.westby@ubuntu.com-20051021224719-leph4w2y3pct4al2
Tags: 1.5-4
* Added new patches from Taco IJsselmuiden:
  + Fixed an off-by-one in 'play <n>' commando. (closes: #334963)
  + Fixed '-r next' and '-r prev' when not playing. (closes: #334964)
  + Added start/stop/clear commandline commandos. (closes: #334965)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
if [ $# -ne 1 ]; then 
 
3
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
4
    exit 1  
 
5
fi
 
6
case "$1" in 
 
7
    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
 
8
    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
 
9
    *)
 
10
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
 
11
        exit 1;;
 
12
esac
 
13
 
 
14
exit 0
 
15
 
 
16
@DPATCH@
 
17
diff -ur orpheus-1.5.debian/src/abstract/userinterface.h orpheus-1.5/src/abstract/userinterface.h
 
18
--- orpheus-1.5.debian/src/abstract/userinterface.h     2004-02-14 16:11:25.000000000 +0100
 
19
+++ orpheus-1.5/src/abstract/userinterface.h    2005-10-21 08:57:02.000000000 +0200
 
20
@@ -19,6 +19,9 @@
 
21
        virtual void doadd(const string &aitem) = 0;
 
22
        virtual void loadplaylist(const string &lname) = 0;
 
23
        virtual void play(int n) = 0;
 
24
+       virtual void playcurrent() = 0;
 
25
+       virtual void stop() = 0;
 
26
+       virtual void clear() = 0;
 
27
 
 
28
        virtual void commandline(int argc, char **argv) { }
 
29
        virtual void status(const string &s) { }
 
30
diff -ur orpheus-1.5.debian/src/main.cc orpheus-1.5/src/main.cc
 
31
--- orpheus-1.5.debian/src/main.cc      2004-02-14 18:11:05.000000000 +0100
 
32
+++ orpheus-1.5/src/main.cc     2005-10-21 08:58:31.000000000 +0200
 
33
@@ -60,6 +60,15 @@
 
34
            } else if(tok == "play") {
 
35
                ui.play(atoi(cmd.c_str()));
 
36
 
 
37
+           } else if(tok == "stop") {
 
38
+               ui.stop();
 
39
+
 
40
+           } else if(tok == "start") {
 
41
+               ui.playcurrent();
 
42
+
 
43
+           } else if(tok == "clear") {
 
44
+               ui.clear();
 
45
+
 
46
            }
 
47
 
 
48
            f.close();
 
49
diff -ur orpheus-1.5.debian/src/uitext.cc orpheus-1.5/src/uitext.cc
 
50
--- orpheus-1.5.debian/src/uitext.cc    2004-02-17 02:18:21.000000000 +0100
 
51
+++ orpheus-1.5/src/uitext.cc   2005-10-21 09:01:22.000000000 +0200
 
52
@@ -161,6 +161,30 @@
 
53
     }
 
54
 }
 
55
 
 
56
+void OrpheusTextUI::stop() {
 
57
+       cleartrack();
 
58
+       update();
 
59
+}
 
60
+void OrpheusTextUI::clear() {
 
61
+       cleartrack();
 
62
+       plist.clear();
 
63
+       update();
 
64
+}
 
65
+void OrpheusTextUI::playcurrent() {
 
66
+    OrpheusPlayList::iterator nt;
 
67
+    if ( !currenttrack ) {
 
68
+       nt = plist.begin() + trackm.getpos();
 
69
+    } else {
 
70
+       nt = find(plist.begin(), plist.end(), currenttrack);
 
71
+    }
 
72
+    if (nt != plist.end()) {
 
73
+       playtrack(*nt);
 
74
+    } else {
 
75
+       cleartrack();
 
76
+       update();
 
77
+    }
 
78
+}
 
79
+
 
80
 void OrpheusTextUI::loadcolors() {
 
81
     string fname = (string) getenv("HOME") + "/.orpheus/colors";
 
82
 
 
83
diff -ur orpheus-1.5.debian/src/uitext.h orpheus-1.5/src/uitext.h
 
84
--- orpheus-1.5.debian/src/uitext.h     2004-02-14 15:53:34.000000000 +0100
 
85
+++ orpheus-1.5/src/uitext.h    2005-10-21 09:01:38.000000000 +0200
 
86
@@ -55,6 +55,9 @@
 
87
        void playtrack(track *t);
 
88
        void cleartrack();
 
89
        void play(int n);
 
90
+       void playcurrent();
 
91
+       void stop();
 
92
+       void clear();
 
93
 
 
94
        void configuration();
 
95
        void mixer();