01: // Copyright (c) 2002 Cunningham & Cunningham, Inc.
02: // Released under the terms of the GNU General Public License version 2 or later.
03:
04: package eg.music;
05:
06: import fit.*;
07:
08: public class Browser extends Fixture {
09:
10: // Library //////////////////////////////////
11:
12: public void library(String path) throws Exception {
13: MusicLibrary.load(path);
14: }
15:
16: public int totalSongs() {
17: return MusicLibrary.library.length;
18: }
19:
20: // Select Detail ////////////////////////////
21:
22: public String playing() {
23: return MusicPlayer.playing.title;
24: }
25:
26: public void select(int i) {
27: MusicLibrary.select(MusicLibrary.library[i - 1]);
28: }
29:
30: public String title() {
31: return MusicLibrary.looking.title;
32: }
33:
34: public String artist() {
35: return MusicLibrary.looking.artist;
36: }
37:
38: public String album() {
39: return MusicLibrary.looking.album;
40: }
41:
42: public int year() {
43: return MusicLibrary.looking.year;
44: }
45:
46: public double time() {
47: return MusicLibrary.looking.time();
48: }
49:
50: public String track() {
51: return MusicLibrary.looking.track();
52: }
53:
54: // Search Buttons ///////////////////////////
55:
56: public void sameAlbum() {
57: MusicLibrary.findAlbum(MusicLibrary.looking.album);
58: }
59:
60: public void sameArtist() {
61: MusicLibrary.findArtist(MusicLibrary.looking.artist);
62: }
63:
64: public void sameGenre() {
65: MusicLibrary.findGenre(MusicLibrary.looking.genre);
66: }
67:
68: public void sameYear() {
69: MusicLibrary.findYear(MusicLibrary.looking.year);
70: }
71:
72: public int selectedSongs() {
73: return MusicLibrary.displayCount();
74: }
75:
76: public void showAll() {
77: MusicLibrary.findAll();
78: }
79:
80: // Play Buttons /////////////////////////////
81:
82: public void play() {
83: MusicPlayer.play(MusicLibrary.looking);
84: }
85:
86: public void pause() {
87: MusicPlayer.pause();
88: }
89:
90: public String status() {
91: return Music.status;
92: }
93:
94: public double remaining() {
95: return MusicPlayer.minutesRemaining();
96: }
97:
98: }
|