diff options
author | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
commit | 8a2c2824a59d7644e13bc52c9a0ecbd641f21f95 (patch) | |
tree | 064ad3f2bf8daab0ad27b128abd86a9bbdb1e496 /muse2/share/pybridge/examples/setpositionexample.py | |
parent | a27706d9629e8b592cca4659f865b70adef24e6d (diff) |
new branch muse2, first checkin
Diffstat (limited to 'muse2/share/pybridge/examples/setpositionexample.py')
-rw-r--r-- | muse2/share/pybridge/examples/setpositionexample.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/muse2/share/pybridge/examples/setpositionexample.py b/muse2/share/pybridge/examples/setpositionexample.py new file mode 100644 index 00000000..476410d9 --- /dev/null +++ b/muse2/share/pybridge/examples/setpositionexample.py @@ -0,0 +1,35 @@ +""" +//========================================================= +// MusE +// Linux Music Editor +// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net) +//========================================================= +""" + +import Pyro.core +import time +muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse') +parts = muse.getParts("Track 1") + +ptick = parts[0]['tick'] +len = parts[0]['len'] +muse.setLPos(ptick) +muse.setRPos(ptick + len) +muse.setCPos(ptick + len / 2) + +songlen = muse.getSongLen() +#print "Song length: " + str(songlen) + +# +# Copy first part to after current song length, thus increase song length with length of first part +# +newsonglen = songlen + parts[0]['len'] +muse.setSongLen(newsonglen) +muse.createPart("Track 1", songlen + 1, parts[0]['len'], parts[0]) +time.sleep(1) + +lastpart = muse.getParts("Track 1").pop() +print lastpart['id'] +muse.deletePart(lastpart['id']) +print muse.getDivision() + |