Mercurial > touhou
comparison pytouhou/formats/music.py @ 321:61adb5453e46
Implement music playback.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 13 Jun 2012 15:29:43 +0200 |
parents | |
children | d1f0bb0b7a17 |
comparison
equal
deleted
inserted
replaced
320:1a4ffdda8735 | 321:61adb5453e46 |
---|---|
1 # -*- encoding: utf-8 -*- | |
2 ## | |
3 ## Copyright (C) 2012 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | |
4 ## | |
5 ## This program is free software; you can redistribute it and/or modify | |
6 ## it under the terms of the GNU General Public License as published | |
7 ## by the Free Software Foundation; version 3 only. | |
8 ## | |
9 ## This program is distributed in the hope that it will be useful, | |
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 ## GNU General Public License for more details. | |
13 ## | |
14 | |
15 | |
16 from struct import unpack | |
17 | |
18 | |
19 class Track(object): | |
20 def __init__(self): | |
21 self.start = 0 | |
22 self.end = 0 | |
23 | |
24 | |
25 @classmethod | |
26 def read(cls, file): | |
27 self = cls() | |
28 self.start, self.end = unpack('<II', file.read(8)) | |
29 return self |