[xiph-commits] r3314 - in arkaiv/trunk/arkaiv: controllers model
templates
dcrowdy at svn.annodex.net
dcrowdy at svn.annodex.net
Sun Dec 16 03:55:14 PST 2007
Author: dcrowdy
Date: 2007-12-16 03:55:13 -0800 (Sun, 16 Dec 2007)
New Revision: 3314
Modified:
arkaiv/trunk/arkaiv/controllers/page.py
arkaiv/trunk/arkaiv/controllers/page.pyc
arkaiv/trunk/arkaiv/model/__init__.py
arkaiv/trunk/arkaiv/model/__init__.pyc
arkaiv/trunk/arkaiv/templates/playlistview.mak
Log:
Added playlist callback function to the playlist view, so that playback continues with the next track once the previous track has finished playing. Works with video, not audio however.
Modified: arkaiv/trunk/arkaiv/controllers/page.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/page.py 2007-12-11 06:45:14 UTC (rev 3313)
+++ arkaiv/trunk/arkaiv/controllers/page.py 2007-12-16 11:55:13 UTC (rev 3314)
@@ -137,7 +137,7 @@
# Need to extract appropriate info for the playlist selected
playlistid = int(request.params['id'])
print "playlist id is \n\n"
- print playlistid
+# print playlistid
c.name = request.params['name']
clips = model.getclipsfromplaylist(playlistid)
items = model.getitemsfromplaylist(playlistid)
Modified: arkaiv/trunk/arkaiv/controllers/page.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/model/__init__.py
===================================================================
--- arkaiv/trunk/arkaiv/model/__init__.py 2007-12-11 06:45:14 UTC (rev 3313)
+++ arkaiv/trunk/arkaiv/model/__init__.py 2007-12-16 11:55:13 UTC (rev 3314)
@@ -396,7 +396,7 @@
def getclipsfromplaylist(listid):
pi_q = Session.query(Playlistitems)
pi = pi_q.filter_by(ixp=listid).all()
- print pi
+ #print pi
c_q = Session.query(Clip)
clips = []
for item in pi:
@@ -495,39 +495,48 @@
name = i.name
return name
-def getitemforid(id):
- item_q = Session.query(Item)
- i = item_q.filter_by(ixi=id).first()
- return i
+#def getitemforid(id):
+# # FIXME Not returning a dict - returning a database object at this stage
+# item_q = Session.query(Item)
+# i = item_q.filter_by(ixi=id).first()
+# return i
def getitemforclip(clipid):
+ # FIXME Not returning a dict - returning a database object at this stage
ic_q = Session.query(Itemclips)
ic = ic_q.filter_by(ixc=clipid).first()
i_q = Session.query(Item)
i = i_q.filter_by(ixi=ic.ixi).first()
+
+ item = {}
+ item['ixi'] = i.ixi
+ item['name'] = i.name
+ item['cmmlfile'] = i.cmmlfile
+
return i
-def getclip(clipid):
- c_q = Session.query(Clip)
- c = c_q.filter_by(ixc=clipid).first()
- return c
-def getheadmeta(id):
- meta_q = Session.query(Meta)
- m = meta_q.filter_by(ixm=id).first()
- return m
+#def getclip(clipid):
+# c_q = Session.query(Clip)
+# c = c_q.filter_by(ixc=clipid).first()
+# return c
-def getitemforheadmeta(metaid):
- #first get the head
- hm_q = Session.query(Headmetas)
- h = hm_q.filter_by(ixm=metaid).first()
- ih_q = Session.query(Itemheads)
- ih = ih_q.filter_by(ixh=h.ixh).first()
- i_q = Session.query(Item)
- i = i_q.filter_by(ixi=ih.ixi).first()
- return i
+#def getheadmeta(id):
+# meta_q = Session.query(Meta)
+# m = meta_q.filter_by(ixm=id).first()
+# return m
+#def getitemforheadmeta(metaid):
+# #first get the head
+# hm_q = Session.query(Headmetas)
+# h = hm_q.filter_by(ixm=metaid).first()
+# ih_q = Session.query(Itemheads)
+# ih = ih_q.filter_by(ixh=h.ixh).first()
+# i_q = Session.query(Item)
+# i = i_q.filter_by(ixi=ih.ixi).first()
+# return i
+
def getitemcmmlfile(id):
item_q = Session.query(Item)
i = item_q.filter_by(ixi=id).first()
@@ -579,9 +588,6 @@
cliplist = []
clip_q = Session.query(Clip)
- # FIXME - why not just return a list of the objects? Why the dictionary
- # step? Madness.
-
for ic in iclist:
# get individual meta info
clipinfo = {}
Modified: arkaiv/trunk/arkaiv/model/__init__.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/templates/playlistview.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/playlistview.mak 2007-12-11 06:45:14 UTC (rev 3313)
+++ arkaiv/trunk/arkaiv/templates/playlistview.mak 2007-12-16 11:55:13 UTC (rev 3314)
@@ -38,6 +38,8 @@
addOutput("clips length is " + clips.length);
+RegisterPlaylistCallback();
+
for (i=1; i < clips.length; i++) {
addOutput(clips[i].value)
plugin.appendMovie(clips[i].value)
@@ -45,6 +47,19 @@
GetPlaylistLength();
+function myEndPlayCallback() {
+ addOutput("End of track");
+}
+
+function RegisterPlaylistCallback() {
+ plugin.registerPlaylistCallback(
+ {
+ call: function() { myEndPlayCallback(); }
+ }
+);
+addOutput("Registered playlist callback");
+}
+
function Play() {
plugin.play();
addOutput("Play!");
More information about the commits
mailing list