iTunes-Steuerung / Ereignisse abfangen

LastSamurai

Mitglied
Ich arbeite gerade an einem Programm das iTunes ergänzen soll. Um darauf zu zugreifen nutze ich die JACOB Bridge und eine iTunes api. Meine Frage ist es jetzt wie ich das Ereigniss abfange, das er ein neues Lied (oder überhaupt erstmal eines) spielt.
Ansatz (der nicht funktioniert) ist folgender:

Java:
//...
        itc = new iTunes();
        itt = itc.getCurrentTrack();
//...

   itc.addEventHandler(new iTunesEventsInterface() {

            public void onDatabaseChangedEvent(int[][] deletedObjectIDs, int[][] changedObjectIDs) {
                System.out.println("1");
                throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onPlayerPlayEvent(ITTrack iTrack) {
                System.out.println("2");
                System.out.println(iTrack.getName());
                //throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onPlayerStopEvent(ITTrack iTrack) {
                System.out.println("3");
                throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onPlayerPlayingTrackChangedEvent(ITTrack iTrack) {
                System.out.println("4");
                System.out.println("neues Lied wird gespielt1");
                //throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onCOMCallsDisabledEvent(ITCOMDisabledReason reason) {
                System.out.println("4");
                throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onCOMCallsEnabledEvent() {
                System.out.println("5");
                throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onQuittingEvent() {
                System.out.println("6");
                throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onAboutToPromptUserToQuitEvent() {
                System.out.println("7");
                throw new UnsupportedOperationException("Not supported yet.");
            }

            public void onSoundVolumeChangedEvent(int newVolume) {
                System.out.println("8");
                throw new UnsupportedOperationException("Not supported yet.");
            }
        });

Er gibt aber nie eine der Zahlen aus. Hoffe mir kann jemand helfen :rtfm::toll:
 

Ähnliche Java Themen

Neue Themen


Oben