aboutsummaryrefslogtreecommitdiff
path: root/sound/vorbis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sound/vorbis.cpp')
-rw-r--r--sound/vorbis.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp
index 4c515257af..6f2cd53463 100644
--- a/sound/vorbis.cpp
+++ b/sound/vorbis.cpp
@@ -156,8 +156,21 @@ VorbisTrackInfo::~VorbisTrackInfo() {
}
}
-DigitalTrackInfo *makeVorbisTrackInfo(File *file) {
- return new VorbisTrackInfo(file);
+DigitalTrackInfo *getVorbisTrack(int track) {
+ char track_name[32];
+ File *file = new File();
+
+ sprintf(track_name, "track%d.ogg", track);
+ file->open(track_name);
+
+ if (file->isOpen()) {
+ VorbisTrackInfo *trackInfo = new VorbisTrackInfo(file);
+ if (!trackInfo->error())
+ return trackInfo;
+ delete trackInfo;
+ }
+ delete file;
+ return NULL;
}
#pragma mark -