Merge lp:~teemu-heinamaki/ubuntu/maverick/tuxguitar/merge-from-debian into lp:ubuntu/maverick/tuxguitar

Proposed by Hippu
Status: Work in progress
Proposed branch: lp:~teemu-heinamaki/ubuntu/maverick/tuxguitar/merge-from-debian
Merge into: lp:ubuntu/maverick/tuxguitar
Diff against target: 36447 lines (+20271/-4937)
422 files modified
.pc/.version (+1/-0)
.pc/01-tuxguitar-rzr.patch/misc/tuxguitar.sh (+161/-0)
.pc/applied-patches (+1/-0)
AUTHORS (+10/-2)
ChangeLog (+16/-10)
Makefile (+18/-18)
TuxGuitar-AudioUnit/How to Install.txt (+33/-0)
TuxGuitar-AudioUnit/build.properties (+7/-0)
TuxGuitar-AudioUnit/build.xml (+66/-0)
TuxGuitar-AudioUnit/jni/Makefile (+26/-0)
TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.cpp (+335/-0)
TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.h (+85/-0)
TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/JNILibraryLoader.java (+65/-0)
TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortImpl.java (+44/-0)
TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderAudioUnit.java (+27/-0)
TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderPlugin.java (+28/-0)
TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverImpl.java (+107/-0)
TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverJNI.java (+37/-0)
TuxGuitar-CoreAudio/How to Install.txt (+33/-0)
TuxGuitar-CoreAudio/build.properties (+1/-1)
TuxGuitar-CoreAudio/src/org/herac/tuxguitar/player/impl/midiport/coreaudio/MidiPortImpl.java (+14/-3)
TuxGuitar-alsa/GNUmakefile (+41/-42)
TuxGuitar-alsa/build.properties (+1/-1)
TuxGuitar-alsa/jni/org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem.c (+5/-5)
TuxGuitar-alsa/src/org/herac/tuxguitar/player/impl/midiport/alsa/MidiOutputPortImpl.java (+14/-13)
TuxGuitar-ascii/GNUmakefile (+27/-27)
TuxGuitar-ascii/build.properties (+1/-1)
TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIIPluginExporter.java (+2/-2)
TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIISongExporter.java (+13/-4)
TuxGuitar-browser-ftp/GNUmakefile (+72/-0)
TuxGuitar-browser-ftp/build.properties (+1/-1)
TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserElementComparator.java (+36/-0)
TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserImpl.java (+4/-0)
TuxGuitar-carbon-integration/build.properties (+1/-1)
TuxGuitar-cocoa-integration/build.properties (+8/-0)
TuxGuitar-cocoa-integration/build.xml (+53/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoa.java (+142/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoaIntegrationPlugin.java (+44/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenu.java (+98/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenuPlugin.java (+31/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarker.java (+44/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarkerPlugin.java (+31/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocAction.java (+69/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocListener.java (+59/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocPlugin.java (+31/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbar.java (+103/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarAction.java (+19/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarDelegate.java (+10/-0)
TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarPlugin.java (+38/-0)
TuxGuitar-community/GNUmakefile (+84/-0)
TuxGuitar-community/build.properties (+23/-0)
TuxGuitar-community/build.xml (+63/-0)
TuxGuitar-community/share/lang/messages.properties (+25/-0)
TuxGuitar-community/share/lang/messages_ca.properties (+23/-0)
TuxGuitar-community/share/lang/messages_en.properties (+25/-0)
TuxGuitar-community/share/lang/messages_es.properties (+23/-0)
TuxGuitar-community/share/lang/messages_eu.properties (+23/-0)
TuxGuitar-community/share/lang/messages_ja.properties (+23/-0)
TuxGuitar-community/share/lang/messages_pl.properties (+23/-0)
TuxGuitar-community/share/lang/messages_pt.properties (+23/-0)
TuxGuitar-community/share/lang/messages_sv.properties (+29/-0)
TuxGuitar-community/share/lang/messages_zh_GB.properties (+23/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunityPluginImpl.java (+49/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunitySingleton.java (+49/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuth.java (+82/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuthDialog.java (+176/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Decoder.java (+96/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Encoder.java (+132/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserAuthDialog.java (+128/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserConnection.java (+45/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserDataImpl.java (+18/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserElementImpl.java (+69/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserFactoryImpl.java (+41/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserImpl.java (+51/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserPluginImpl.java (+13/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserRequest.java (+57/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserResponse.java (+130/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFile.java (+51/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFileDialog.java (+195/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSong.java (+131/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongConnection.java (+29/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongExporter.java (+26/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongPlugin.java (+12/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongRequest.java (+78/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongResponse.java (+90/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/startup/TGCommunityStartupPlugin.java (+30/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/startup/TGCommunityStartupScreen.java (+171/-0)
TuxGuitar-community/src/org/herac/tuxguitar/community/utils/TGCommunityWeb.java (+80/-0)
TuxGuitar-compat/GNUmakefile (+27/-27)
TuxGuitar-compat/build.properties (+1/-1)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/TGPluginListImpl.java (+12/-2)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v07/TGInputStream.java (+6/-6)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v08/TGInputStream.java (+6/-6)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v09/TGInputStream.java (+7/-7)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v09/TGStream.java (+1/-1)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v10/TGInputStream.java (+8/-8)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v10/TGOutputStream.java (+15/-12)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v10/TGStream.java (+1/-1)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v11/TGInputStream.java (+748/-0)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v11/TGOutputStream.java (+705/-0)
TuxGuitar-compat/src/org/herac/tuxguitar/io/tg/v11/TGStream.java (+203/-0)
TuxGuitar-converter/GNUmakefile (+34/-27)
TuxGuitar-converter/build.properties (+1/-1)
TuxGuitar-converter/share/lang/messages_sv.properties (+23/-0)
TuxGuitar-converter/src/org/herac/tuxguitar/gui/tools/custom/converter/DestinationFileTypeCombo.java (+0/-66)
TuxGuitar-converter/src/org/herac/tuxguitar/gui/tools/custom/converter/TGConverter.java (+30/-48)
TuxGuitar-converter/src/org/herac/tuxguitar/gui/tools/custom/converter/TGConverterDialog.java (+25/-16)
TuxGuitar-converter/src/org/herac/tuxguitar/gui/tools/custom/converter/TGConverterFormat.java (+20/-0)
TuxGuitar-converter/src/org/herac/tuxguitar/gui/tools/custom/converter/TGConverterProcess.java (+8/-8)
TuxGuitar-fluidsynth/GNUmakefile (+48/-42)
TuxGuitar-fluidsynth/jni/org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.c (+266/-47)
TuxGuitar-fluidsynth/jni/org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.h (+110/-6)
TuxGuitar-fluidsynth/share/lang/messages.properties (+17/-4)
TuxGuitar-fluidsynth/share/lang/messages_sv.properties (+23/-0)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/MidiOutputPortImpl.java (+15/-4)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/MidiOutputPortProviderImpl.java (+1/-1)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/MidiOutputPortSettings.java (+395/-125)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/MidiSettings.java (+156/-0)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/MidiSynth.java (+140/-20)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/type/BooleanRef.java (+18/-0)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/type/DoubleRef.java (+18/-0)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/type/IntegerRef.java (+18/-0)
TuxGuitar-fluidsynth/src/org/herac/tuxguitar/player/impl/midiport/fluidsynth/type/StringRef.java (+18/-0)
TuxGuitar-gervill/build.properties (+1/-1)
TuxGuitar-gervill/src/org/herac/tuxguitar/io/gervill/MidiToAudioExporter.java (+17/-9)
TuxGuitar-gervill/src/org/herac/tuxguitar/io/gervill/MidiToAudioPlugin.java (+29/-8)
TuxGuitar-gervill/src/org/herac/tuxguitar/io/gervill/MidiToAudioSynth.java (+2/-3)
TuxGuitar-gtp/GNUmakefile (+45/-28)
TuxGuitar-gtp/build.properties (+1/-1)
TuxGuitar-gtp/share/lang/messages_sv.properties (+9/-0)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP1InputStream.java (+21/-9)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP2InputStream.java (+21/-10)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP3InputStream.java (+39/-25)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP3OutputStream.java (+27/-7)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP4InputStream.java (+39/-25)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP4OutputStream.java (+27/-7)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP5InputStream.java (+41/-26)
TuxGuitar-gtp/src/org/herac/tuxguitar/io/gtp/GP5OutputStream.java (+25/-7)
TuxGuitar-jack/GNUmakefile (+94/-0)
TuxGuitar-jack/build.properties (+8/-0)
TuxGuitar-jack/build.xml (+51/-0)
TuxGuitar-jack/jni/GNUmakefile (+24/-0)
TuxGuitar-jack/jni/org_herac_tuxguitar_jack_JackClient.c (+430/-0)
TuxGuitar-jack/jni/org_herac_tuxguitar_jack_JackClient.h (+133/-0)
TuxGuitar-jack/share/META-INF/services/org.herac.tuxguitar.gui.system.plugins.TGPlugin (+1/-0)
TuxGuitar-jack/share/lang/messages.properties (+31/-0)
TuxGuitar-jack/share/lang/messages_sv.properties (+38/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/JackClient.java (+190/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/JackPluginImpl.java (+59/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackEvent.java (+73/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackEventController.java (+94/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackEventDispacher.java (+35/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackSequenceHandler.java (+47/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackSequencer.java (+277/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackSequencerProvider.java (+37/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackSequencerProviderPlugin.java (+23/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackTickController.java (+126/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackTrack.java (+28/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/sequencer/JackTrackController.java (+85/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/settings/JackSettings.java (+50/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/settings/JackSettingsDialog.java (+554/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/settings/JackSettingsListener.java (+9/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/synthesizer/JackOutputPort.java (+75/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/synthesizer/JackOutputPortProvider.java (+35/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/synthesizer/JackOutputPortProviderPlugin.java (+23/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/synthesizer/JackOutputPortRouter.java (+185/-0)
TuxGuitar-jack/src/org/herac/tuxguitar/jack/synthesizer/JackReceiver.java (+66/-0)
TuxGuitar-jsa/share/lang/messages_ja.properties (+1/-1)
TuxGuitar-jsa/src/org/herac/tuxguitar/player/impl/jsa/midiport/MidiPortOut.java (+13/-2)
TuxGuitar-jsa/src/org/herac/tuxguitar/player/impl/jsa/midiport/MidiPortSynthesizer.java (+13/-2)
TuxGuitar-jsa/src/org/herac/tuxguitar/player/impl/jsa/sequencer/MidiReceiverImpl.java (+3/-1)
TuxGuitar-jsa/src/org/herac/tuxguitar/player/impl/jsa/sequencer/MidiSequencerImpl.java (+45/-14)
TuxGuitar-jws/build.properties (+15/-90)
TuxGuitar-jws/build.xml (+144/-53)
TuxGuitar-jws/jws/tuxguitar.jnlp (+25/-15)
TuxGuitar-lilypond/GNUmakefile (+34/-27)
TuxGuitar-lilypond/build.properties (+1/-1)
TuxGuitar-lilypond/share/lang/messages_sv.properties (+23/-0)
TuxGuitar-lilypond/src/org/herac/tuxguitar/io/lilypond/LilypondOutputStream.java (+383/-231)
TuxGuitar-lilypond/src/org/herac/tuxguitar/io/lilypond/LilypondPluginExporter.java (+2/-2)
TuxGuitar-lilypond/src/org/herac/tuxguitar/io/lilypond/LilypondSongExporter.java (+11/-5)
TuxGuitar-midi/GNUmakefile (+27/-27)
TuxGuitar-midi/build.properties (+1/-1)
TuxGuitar-midi/src/org/herac/tuxguitar/io/midi/MidiPluginExporter.java (+2/-2)
TuxGuitar-midi/src/org/herac/tuxguitar/io/midi/MidiPluginImporter.java (+2/-2)
TuxGuitar-midi/src/org/herac/tuxguitar/io/midi/MidiSongExporter.java (+16/-8)
TuxGuitar-midi/src/org/herac/tuxguitar/io/midi/MidiSongImporter.java (+12/-8)
TuxGuitar-musicxml/GNUmakefile (+27/-27)
TuxGuitar-musicxml/build.properties (+1/-1)
TuxGuitar-musicxml/src/org/herac/tuxguitar/io/musicxml/MusicXMLPluginExporter.java (+2/-2)
TuxGuitar-musicxml/src/org/herac/tuxguitar/io/musicxml/MusicXMLSongExporter.java (+13/-4)
TuxGuitar-musicxml/src/org/herac/tuxguitar/io/musicxml/MusicXMLWriter.java (+6/-6)
TuxGuitar-oss/GNUmakefile (+42/-42)
TuxGuitar-oss/build.properties (+1/-1)
TuxGuitar-oss/jni/org_herac_tuxguitar_player_impl_midiport_oss_MidiSystem.c (+5/-5)
TuxGuitar-oss/src/org/herac/tuxguitar/player/impl/midiport/oss/MidiOutputPortImpl.java (+11/-14)
TuxGuitar-pdf/build.properties (+1/-1)
TuxGuitar-pdf/src/org/herac/tuxguitar/io/pdf/PDFPluginExporter.java (+2/-2)
TuxGuitar-pdf/src/org/herac/tuxguitar/io/pdf/PDFSongExporter.java (+18/-9)
TuxGuitar-ptb/GNUmakefile (+27/-27)
TuxGuitar-ptb/build.properties (+1/-1)
TuxGuitar-ptb/src/org/herac/tuxguitar/io/ptb/PTInputStream.java (+1/-1)
TuxGuitar-ptb/src/org/herac/tuxguitar/io/ptb/PTSongParser.java (+45/-3)
TuxGuitar-ptb/src/org/herac/tuxguitar/io/ptb/PTSongSynchronizerUtil.java (+7/-1)
TuxGuitar-ptb/src/org/herac/tuxguitar/io/ptb/base/PTSection.java (+5/-5)
TuxGuitar-ptb/src/org/herac/tuxguitar/io/ptb/base/PTSongInfo.java (+25/-0)
TuxGuitar-tef/GNUmakefile (+27/-27)
TuxGuitar-tef/build.properties (+1/-1)
TuxGuitar-tef/src/org/herac/tuxguitar/io/tef/TEPluginImporter.java (+2/-2)
TuxGuitar-tef/src/org/herac/tuxguitar/io/tef/TESongImporter.java (+17/-10)
TuxGuitar-tray/GNUmakefile (+27/-27)
TuxGuitar-tray/build.properties (+1/-1)
TuxGuitar-tray/src/org/herac/tuxguitar/tray/TGTrayMenu.java (+6/-17)
TuxGuitar-tray/src/org/herac/tuxguitar/tray/TGTrayPlugin.java (+5/-5)
TuxGuitar-winmm/build.properties (+1/-1)
TuxGuitar-winmm/jni/org_herac_tuxguitar_player_impl_midiport_winmm_MidiSystem.c (+8/-14)
TuxGuitar-winmm/src/org/herac/tuxguitar/player/impl/midiport/winmm/MidiOutputPortImpl.java (+13/-4)
TuxGuitar/GNUmakefile (+12/-8)
TuxGuitar/build.properties (+5/-5)
TuxGuitar/dist/about_authors.dist (+10/-2)
TuxGuitar/dist/about_description.dist (+2/-1)
TuxGuitar/dist/config.dist (+1/-1)
TuxGuitar/dist/shortcuts-default.xml (+1/-1)
TuxGuitar/doc/AUTHORS (+10/-2)
TuxGuitar/doc/CHANGES (+16/-10)
TuxGuitar/share/help/about.html (+14/-2)
TuxGuitar/share/help/start_toolbars.html (+1/-1)
TuxGuitar/share/help/whatsnew.html (+33/-1)
TuxGuitar/share/lang/messages.properties (+53/-3)
TuxGuitar/share/lang/messages_ca.properties (+66/-2)
TuxGuitar/share/lang/messages_cs.properties (+2/-2)
TuxGuitar/share/lang/messages_de.properties (+2/-2)
TuxGuitar/share/lang/messages_en.properties (+75/-5)
TuxGuitar/share/lang/messages_es.properties (+68/-3)
TuxGuitar/share/lang/messages_eu.properties (+1103/-0)
TuxGuitar/share/lang/messages_fr.properties (+2/-2)
TuxGuitar/share/lang/messages_hu.properties (+2/-2)
TuxGuitar/share/lang/messages_it.properties (+2/-2)
TuxGuitar/share/lang/messages_ja.properties (+685/-621)
TuxGuitar/share/lang/messages_nl.properties (+2/-2)
TuxGuitar/share/lang/messages_pl.properties (+66/-5)
TuxGuitar/share/lang/messages_pt.properties (+67/-3)
TuxGuitar/share/lang/messages_ru.properties (+2/-2)
TuxGuitar/share/lang/messages_sr.properties (+2/-2)
TuxGuitar/share/lang/messages_sv.properties (+84/-11)
TuxGuitar/share/lang/messages_uk.properties (+2/-2)
TuxGuitar/share/lang/messages_vi.properties (+2/-2)
TuxGuitar/share/lang/messages_zh_GB.properties (+95/-5)
TuxGuitar/share/lang/messages_zh_TW.properties (+2/-2)
TuxGuitar/share/scales/scales.xml (+278/-93)
TuxGuitar/src/org/herac/tuxguitar/gui/TuxGuitar.java (+43/-33)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/ActionManager.java (+14/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/composition/ChangeInfoAction.java (+60/-7)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/duration/ChangeDivisionTypeAction.java (+95/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/duration/ChangeTupletoDurationAction.java (+0/-95)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/file/ExportSongAction.java (+66/-20)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/file/FileActionUtils.java (+32/-9)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/file/ImportSongAction.java (+37/-6)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/file/OpenFileAction.java (+3/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/insert/InsertChordAction.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/measure/AddMeasureAction.java (+75/-42)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/measure/CleanMeasureAction.java (+147/-13)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/measure/PasteMeasureAction.java (+50/-31)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/note/MoveBeatsCustomAction.java (+335/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/note/MoveBeatsLeftAction.java (+53/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/note/MoveBeatsRightAction.java (+53/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/system/DisposeAction.java (+15/-12)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/tools/TransposeAction.java (+230/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/track/TrackPropertiesAction.java (+103/-20)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/transport/TransportModeAction.java (+221/-31)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/transport/TransportPlayAction.java (+1/-62)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/transport/TransportSetLoopEHeaderAction.java (+27/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/transport/TransportSetLoopSHeaderAction.java (+27/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/actions/transport/TransportStopAction.java (+1/-14)
TuxGuitar/src/org/herac/tuxguitar/gui/clipboard/MeasureTransferable.java (+25/-18)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/EditorCache.java (+0/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/TGPainter.java (+51/-40)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/TGPainterUtils.java (+1/-24)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/TGUpdateListener.java (+1/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/TablatureEditor.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/chord/ChordCreatorUtil.java (+19/-32)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/chord/ChordDialog.java (+3/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/chord/ChordEditor.java (+14/-11)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/chord/ChordSettingsDialog.java (+2/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/effects/BendEditor.java (+3/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/effects/GraceEditor.java (+0/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/effects/StrokeEditor.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/effects/TremoloBarEditor.java (+3/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/effects/TrillEditor.java (+0/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/fretboard/FretBoard.java (+27/-19)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/fretboard/FretBoardConfig.java (+44/-9)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/matrix/MatrixConfig.java (+7/-7)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/matrix/MatrixEditor.java (+186/-151)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/piano/Piano.java (+6/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/piano/PianoConfig.java (+6/-6)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/Caret.java (+15/-18)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGBeatGroup.java (+0/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGBeatImpl.java (+111/-362)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGBeatSpacing.java (+44/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGChordImpl.java (+22/-9)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGLyricImpl.java (+1/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGMeasureBuffer.java (+26/-12)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGMeasureImpl.java (+149/-216)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGNoteImpl.java (+23/-19)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGResources.java (+17/-5)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGSpacing.java (+53/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGTextImpl.java (+1/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGTrackSpacing.java (+90/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/TGVoiceImpl.java (+26/-59)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/Tablature.java (+3/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/edit/EditorKit.java (+2/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/edit/MouseKit.java (+9/-7)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/layout/LinearViewLayout.java (+9/-10)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/layout/PageViewLayout.java (+10/-15)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/layout/PrinterViewLayout.java (+58/-41)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/layout/TrackSpacing.java (+0/-132)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/layout/ViewLayout.java (+58/-26)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/painters/TGTempoPainter.java (+1/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/painters/TGTripletFeelPainter.java (+5/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/help/about/AboutDialog.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/items/ItemManager.java (+94/-12)
TuxGuitar/src/org/herac/tuxguitar/gui/items/menu/BeatMenuItem.java (+29/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/items/menu/DurationMenuItem.java (+8/-8)
TuxGuitar/src/org/herac/tuxguitar/gui/items/menu/FileMenuItem.java (+132/-51)
TuxGuitar/src/org/herac/tuxguitar/gui/items/menu/ToolMenuItem.java (+8/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/items/menu/TrackMenuItem.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/items/menu/TransportMenuItem.java (+24/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/items/tool/BeatToolItems.java (+4/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/items/tool/CompositionToolItems.java (+8/-3)
TuxGuitar/src/org/herac/tuxguitar/gui/items/tool/DurationToolItems.java (+48/-57)
TuxGuitar/src/org/herac/tuxguitar/gui/marker/MarkerEditor.java (+8/-8)
TuxGuitar/src/org/herac/tuxguitar/gui/mixer/TGMixerTrack.java (+13/-18)
TuxGuitar/src/org/herac/tuxguitar/gui/printer/PrintStyles.java (+13/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/printer/PrintStylesDialog.java (+5/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/system/config/TGConfigDefaults.java (+16/-13)
TuxGuitar/src/org/herac/tuxguitar/gui/system/config/TGConfigKeys.java (+3/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/system/config/TGConfigManager.java (+36/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/system/icons/IconManager.java (+4/-4)
TuxGuitar/src/org/herac/tuxguitar/gui/system/plugins/TGPluginConfigManager.java (+1/-5)
TuxGuitar/src/org/herac/tuxguitar/gui/system/plugins/TGPluginManager.java (+3/-3)
TuxGuitar/src/org/herac/tuxguitar/gui/system/plugins/base/TGExporterPlugin.java (+3/-3)
TuxGuitar/src/org/herac/tuxguitar/gui/system/plugins/base/TGImporterPlugin.java (+3/-3)
TuxGuitar/src/org/herac/tuxguitar/gui/system/plugins/base/TGMidiOutputPortProviderPlugin.java (+0/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/system/plugins/base/TGMidiSequencerProviderPlugin.java (+0/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/table/TGTableCanvasPainter.java (+4/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/table/TGTableViewer.java (+16/-6)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/TGBrowserManager.java (+24/-7)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/dialog/TGBrowserBar.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/dialog/TGBrowserDialog.java (+0/-4)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/dialog/TGBrowserElementComparator.java (+0/-36)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/dialog/TGBrowserMenuBar.java (+2/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/dialog/TGBrowserToolBar.java (+2/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/filesystem/TGBrowserElementComparator.java (+36/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/browser/filesystem/TGBrowserImpl.java (+4/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/tools/scale/ScaleEditor.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/transport/TGTransport.java (+44/-15)
TuxGuitar/src/org/herac/tuxguitar/gui/transport/TGTransportListener.java (+69/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/undo/undoables/UndoableJoined.java (+4/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/undo/undoables/custom/UndoableChangeInfo.java (+22/-2)
TuxGuitar/src/org/herac/tuxguitar/gui/undo/undoables/measure/UndoableMeasureGeneric.java (+21/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/undo/undoables/track/UndoableTrackGeneric.java (+12/-1)
TuxGuitar/src/org/herac/tuxguitar/gui/undo/undoables/track/UndoableTrackInstrument.java (+6/-6)
TuxGuitar/src/org/herac/tuxguitar/gui/undo/undoables/track/UndoableTrackSoloMute.java (+94/-0)
TuxGuitar/src/org/herac/tuxguitar/gui/util/FileChooser.java (+9/-5)
TuxGuitar/src/org/herac/tuxguitar/gui/util/MidiTickUtil.java (+29/-9)
TuxGuitar/src/org/herac/tuxguitar/gui/util/TGSplash.java (+2/-0)
TuxGuitar/src/org/herac/tuxguitar/io/base/TGFileFormatManager.java (+22/-6)
TuxGuitar/src/org/herac/tuxguitar/io/base/TGLocalFileExporter.java (+15/-0)
TuxGuitar/src/org/herac/tuxguitar/io/base/TGLocalFileImporter.java (+15/-0)
TuxGuitar/src/org/herac/tuxguitar/io/base/TGRawExporter.java (+10/-0)
TuxGuitar/src/org/herac/tuxguitar/io/base/TGRawImporter.java (+11/-0)
TuxGuitar/src/org/herac/tuxguitar/io/base/TGSongExporter.java (+0/-16)
TuxGuitar/src/org/herac/tuxguitar/io/base/TGSongImporter.java (+0/-18)
TuxGuitar/src/org/herac/tuxguitar/io/tg/TGInputStream.java (+23/-8)
TuxGuitar/src/org/herac/tuxguitar/io/tg/TGOutputStream.java (+23/-8)
TuxGuitar/src/org/herac/tuxguitar/io/tg/TGStream.java (+1/-1)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiDevice.java (+14/-0)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiOutputPort.java (+5/-11)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiPlayer.java (+108/-14)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiPlayerListener.java (+10/-0)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiPlayerMode.java (+45/-19)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiPort.java (+0/-23)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiReceiver.java (+2/-0)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiRepeatController.java (+19/-1)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiSequenceHandler.java (+0/-12)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiSequenceParser.java (+87/-58)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiSequencer.java (+1/-9)
TuxGuitar/src/org/herac/tuxguitar/player/base/MidiSequencerEmpty.java (+4/-0)
TuxGuitar/src/org/herac/tuxguitar/player/impl/sequencer/MidiSequencerImpl.java (+9/-1)
TuxGuitar/src/org/herac/tuxguitar/song/factory/TGFactory.java (+7/-7)
TuxGuitar/src/org/herac/tuxguitar/song/helpers/TGSongSegmentHelper.java (+34/-2)
TuxGuitar/src/org/herac/tuxguitar/song/managers/TGMeasureManager.java (+464/-106)
TuxGuitar/src/org/herac/tuxguitar/song/managers/TGSongManager.java (+13/-8)
TuxGuitar/src/org/herac/tuxguitar/song/managers/TGTrackManager.java (+45/-4)
TuxGuitar/src/org/herac/tuxguitar/song/models/TGChannel.java (+3/-3)
TuxGuitar/src/org/herac/tuxguitar/song/models/TGChord.java (+0/-4)
TuxGuitar/src/org/herac/tuxguitar/song/models/TGDivisionType.java (+76/-0)
TuxGuitar/src/org/herac/tuxguitar/song/models/TGDuration.java (+15/-15)
TuxGuitar/src/org/herac/tuxguitar/song/models/TGSong.java (+55/-0)
TuxGuitar/src/org/herac/tuxguitar/song/models/TGTupleto.java (+0/-76)
TuxGuitar/src/org/herac/tuxguitar/song/models/effects/TGEffectTremoloPicking.java (+2/-2)
TuxGuitar/src/org/herac/tuxguitar/song/models/effects/TGEffectTrill.java (+2/-2)
TuxGuitar/src/org/herac/tuxguitar/util/TGLock.java (+17/-21)
TuxGuitar/src/org/herac/tuxguitar/util/TGSynchronizer.java (+4/-4)
TuxGuitar/src/org/herac/tuxguitar/util/TGVersion.java (+1/-1)
TuxGuitar/xml/build-freebsd.xml (+2/-2)
TuxGuitar/xml/build-linux.xml (+12/-8)
TuxGuitar/xml/build-mac.xml (+3/-3)
TuxGuitar/xml/build-ubuntu.xml (+12/-8)
TuxGuitar/xml/build-windows.xml (+17/-8)
build_gcj.sh (+33/-2)
debian/changelog (+81/-9)
debian/compat (+1/-1)
debian/control (+19/-10)
debian/patches/01-tuxguitar-rzr.patch (+394/-0)
debian/patches/series (+1/-0)
debian/rules (+13/-14)
debian/source/format (+1/-0)
debian/tuxguitar-jack.install (+3/-0)
debian/tuxguitar.manpages (+1/-1)
misc/swt-3.3-gtk-linux-x86.patch (+0/-84)
misc/tuxguitar.sh (+38/-22)
To merge this branch: bzr merge lp:~teemu-heinamaki/ubuntu/maverick/tuxguitar/merge-from-debian
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Needs Fixing
Ubuntu branches Pending
Review via email: mp+25794@code.launchpad.net

This proposal supersedes a proposal from 2010-05-17.

Description of the change

Merge from Debian Unstable. Remaining changes are: Use Java Sound API by default and Change Maintainer to Ubuntu-MOTU.

To post a comment you must log in.
Revision history for this message
Micah Gersten (micahg) wrote : Posted in a previous version of this proposal

This needs to have my changes from 1.1-1ubuntu4
Thanks.

Revision history for this message
Daniel Holbach (dholbach) wrote : Posted in a previous version of this proposal

Marking as 'needs fixing' per Micah's comment.

review: Needs Fixing
Revision history for this message
Hippu (teemu-heinamaki) wrote : Posted in a previous version of this proposal

A new merge from 1.2-4 with requested fixes

Revision history for this message
Daniel Holbach (dholbach) wrote :

 - "(LP: 523196)" → "(LP: #523196)"
 - Patch Tagging Guidelines are missing in the patch. Maybe the debian-changes-1.2-4ubuntu1 patch could also have a more revealing filename?

review: Needs Fixing

Unmerged revisions

10. By Hippu

* Merge from Debian, remaining changes (LP: 523196):
  - debian/control
     + Use xulrunner 1.9.2
     + Use jsa-plugin by default
     + Change maintainer to Ubuntu MOTU
  - misc/tuxguitar.sh
     + Search for xulrunner 1.9.2 instead of 1.9.1
* Address bashism in /usr/bin/tuxguitar (Closes: #581142)
  (Thank you to Raphael Geissert)
* Switch to dpkg-source 3.0 (quilt) format
  - remove debian/README.source
  - remove patch-related targets in debian/rules
  - remove build-dep on quilt
* debian/compat - upgrade to debhelper 7
* Remove extraneous LICENSE file.
* Modify tuxguitar.sh to find swt-gtk-3.5.1.jar (Closes: #575898)
* Unbuild tuxguitar-gervill (Closes: #570556) :
  - since it depends on unpackaged component
* Added jack plugin (Closes: #569999)
* Merged upstream files in patch (Closes: #569910)
* Non-maintainer upload.
* debian/control:
  - Update swt-gtk dependency to 3.5 to fix FTBFS. (Closes: #564347)
  - Change XS-Vcs-* fields to Vcs-*.
  - Add ${misc:Depends}.
  - Bump Standards-Version to 3.8.4.
* debian/rules: Don't install redundant LICENSE doc.
* New upstream release (Closes: #510742)
* Merged patch : tuxguitar_1.1-1ubuntu1.patch
* Added Makefile : from upstream repo
* debian/* :
  - Migrated to quilt
  - Updated standards
* Non-maintainer upload for transition to xulrunner 1.9.1.
  (Closes: #548683)
* debian/control: Depend on a xulrunner-1.9.1.
* misc/tuxguitar.sh: Detect xulrunner 1.9.1.
* New upstream release (closes: #405295 , #398972)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.pc'
2=== added file '.pc/.version'
3--- .pc/.version 1970-01-01 00:00:00 +0000
4+++ .pc/.version 2010-05-21 18:17:28 +0000
5@@ -0,0 +1,1 @@
6+2
7
8=== added directory '.pc/01-tuxguitar-rzr.patch'
9=== added file '.pc/01-tuxguitar-rzr.patch/Makefile'
10=== added directory '.pc/01-tuxguitar-rzr.patch/misc'
11=== added file '.pc/01-tuxguitar-rzr.patch/misc/tuxguitar.sh'
12--- .pc/01-tuxguitar-rzr.patch/misc/tuxguitar.sh 1970-01-01 00:00:00 +0000
13+++ .pc/01-tuxguitar-rzr.patch/misc/tuxguitar.sh 2010-05-21 18:17:28 +0000
14@@ -0,0 +1,161 @@
15+#! /bin/sh
16+#@ident "$Id: tuxguitar.sh,v 1.3 2008/04/16 17:04:50 rzr Exp $"
17+#@Author: www.philippe.coval.online.fr -- revision: $Author: rzr $
18+#@Licence: LGPL
19+#@Description: Wrapper script for starting java application tuxguitar
20+###############################################################################
21+PACKAGE=tuxguitar
22+[ ! -z $DEBUG ] && set -e
23+[ ! -z $DEBUG ] && set -x
24+
25+#/// guess JAVA_HOME if undefined
26+java_guess_()
27+{
28+ d="/opt/java/"
29+ [ -d "$t" ] && d="$t"
30+ d="/usr/local/opt/java/"
31+ [ -d "$t" ] && d="$t"
32+# windows
33+ t="C:\\Program\ Files\\Java\\jre1.6.0_03/"
34+ [ -d "$t" ] && d="$t"
35+ t="\\Program\ Files\\Java\\jre1.6.0_03/"
36+ [ -d "$t" ] && d="$t"
37+ t="/Program\ Files/Java/jre1.6.0_03/"
38+ [ -d "$t" ] && d="$t"
39+# macosx
40+ t="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/"
41+ [ -d "$t" ] && d="$t"
42+# opensuse
43+ t="/etc/profile.d/alljava.sh"
44+ [ -r $t ] && . $t && echo ${JAVA_HOME} && return
45+ t="/usr/lib/jvm/java"
46+ [ -d "$t" ] && d="$t"
47+ t="/usr/lib64/jvm/java"
48+ [ -d "$t" ] && d="$t"
49+# mandriva
50+ t="/usr/lib/jvm/jre-1.6.0-sun/bin/../"
51+ [ -d "$t" ] && d="$t"
52+# gentoo
53+ t="/opt/sun-jdk-1.5.0.14/"
54+ [ -d "$t" ] && d="$t"
55+ t="/opt/sun-jdk-1.6.0.04/"
56+ [ -d "$t" ] && d="$t"
57+# debian
58+if [ -r /etc/debian_version ]; then
59+ t="/usr/lib/jvm/java-gcj/jre/bin/../../"
60+ [ -d "$t" ] && d="$t"
61+ t="/usr/lib/jvm/java-1.5.0-sun/jre/bin/../../"
62+ [ -d "$t" ] && d="$t"
63+ t="/usr/lib/jvm/java-6-sun/jre/bin/../../"
64+ [ -d "$t" ] && d="$t"
65+ t="/usr/lib/jvm/java-6-openjdk/jre/bin/../../"
66+ [ -d "$t" ] && d="$t"
67+fi
68+# results
69+ [ -d "$d" ] && echo "$d"
70+}
71+
72+swt_guess_()
73+{
74+ t="/usr/lib/eclipse/plugins/org.eclipse.swt.gtk.linux.*.jar"
75+ [ -r "$t" ] && f="$t"
76+ t="/etc/alternatives/swt.jar"
77+ [ -r "$t" ] && f="$t"
78+ t="/usr/share/java/swt.jar"
79+ [ -r "$t" ] && f="$t"
80+ t="/usr/lib/java/swt.jar"
81+ [ -r "$t" ] && f="$t"
82+ t="/usr/share/java/swt-gtk-3.4.jar"
83+ [ -r "$t" ] && f="$t"
84+ t="/usr/lib/java/swt3.2-gtk.jar"
85+ [ -r "$t" ] && f="$t"
86+ file -L "$f" >/dev/null 2>&1 || f=""
87+ echo "$f"
88+}
89+
90+#/// org.eclipse.swt.SWTError: No more handles
91+#/// [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
92+mozilla_guess_()
93+{
94+ t="/usr/lib/mozilla"
95+ test -r "$t/libxpcom.so" && d="$t"
96+ t="/usr/lib/iceape/"
97+ test -r "$t/libxpcom.so" && d="$t"
98+ t="/usr/lib/icedove/"
99+ test -r "$t/libxpcom.so" && d="$t"
100+ t="/usr/lib/firefox/"
101+ test -r "$t/libxpcom.so" && d="$t"
102+ t="/usr/lib/iceweasel"
103+ test -r "$t/libxpcom.so" && d="$t"
104+ t="/usr/lib/xulrunner"
105+ test -r "$t/libxpcom.so" && d="$t"
106+ t="/usr/lib/xulrunner-1.9"
107+ test -r "$t/libxpcom.so" && d="$t"
108+ echo "$d"
109+}
110+
111+#
112+env_()
113+{
114+# java
115+ [ -z ${JAVA_HOME} ] && t=$(java_guess_) && [ -d "$t" ] && JAVA_HOME=$t
116+ if [ -d "${JAVA_HOME}" ] ; then
117+ export JAVA_HOME
118+ JAVA=${JAVA:=${JAVA_HOME}/jre/bin/java}
119+ [ -x ${JAVA} ] && export JAVA
120+ else
121+ JAVA=${JAVA:=java}
122+ export JAVA
123+ fi
124+
125+# mozilla
126+ [ -z ${MOZILLA_FIVE_HOME} ] && t=$(mozilla_guess_) && [ -d "$t" ] && MOZILLA_FIVE_HOME=$t
127+ if [ -d "$MOZILLA_FIVE_HOME" ] ; then
128+ export MOZILLA_FIVE_HOME
129+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOZILLA_FIVE_HOME
130+ else
131+ echo '$MOZILLA_FIVE_HOME not valid : check doc shipped w/ tuxguitar'
132+ fi
133+
134+ [ ! -z ${DEBUG} ] && echo "# MOZILLA_FIVE_HOME=${MOZILLA_FIVE_HOME}"
135+ [ ! -z ${DEBUG} ] && echo "# JAVA_HOME=${JAVA_HOME}"}
136+}
137+
138+tuxguitar_()
139+{
140+ local PACKAGE=${PACKAGE:=tuxguitar}
141+ local PACKAGE_HOME=${PACKAGE_HOME:=/usr/share/${PACKAGE}/}
142+ local PACKAGE_MAIN=${PACKAGE_MAIN:=org.herac.tuxguitar.gui.TGMain}
143+ local PACKAGE_LIB=${PACKAGE_LIB:=/usr/lib/jni}
144+# java env
145+ JAVA=${JAVA:=java}
146+ CLASSPATH=${CLASSPATH}
147+ t="${PACKAGE_HOME}"
148+ [ -d "$t" ] && CLASSPATH=${CLASSPATH}:$t
149+ t="${PACKAGE_HOME}/${PACKAGE}.jar"
150+ [ -r "$t" ] && CLASSPATH=${CLASSPATH}:$t
151+ t="/usr/share/java/itext.jar"
152+ [ -r "$t" ] && CLASSPATH=${CLASSPATH}:$t
153+ t=$(swt_guess_)
154+ [ -r "$t" ] && CLASSPATH=${CLASSPATH}:$t
155+
156+ JAVA_FLAGS=${JAVA_FLAGS:="-Xms128m -Xmx128m"}
157+ JAVA_FLAGS="\
158+${JAVA_FLAGS} \
159+ -Djava.library.path=${PACKAGE_LIB} \
160+ -D${PACKAGE}.share.path=/usr/share/${PACKAGE} \
161+ -cp ${CLASSPATH}:${PACKAGE_CLASSPATH}"
162+ local arg=""
163+ [ -z "$1" ] && arg="/usr/share/tuxguitar/tuxguitar.tg"
164+# run java
165+ [ ! -z ${DEBUG} ] && ${JAVA} -version
166+ [ ! -z ${DEBUG} ] && ${JAVA} ${JAVA_FLAGS} ${PACKAGE_MAIN} --version
167+
168+ ${JAVA} ${JAVA_FLAGS} ${PACKAGE_MAIN} $arg "$@"
169+}
170+
171+# main
172+env_
173+tuxguitar_ "$@"
174+
175+#eof
176
177=== added file '.pc/applied-patches'
178--- .pc/applied-patches 1970-01-01 00:00:00 +0000
179+++ .pc/applied-patches 2010-05-21 18:17:28 +0000
180@@ -0,0 +1,1 @@
181+01-tuxguitar-rzr.patch
182
183=== modified file 'AUTHORS'
184--- AUTHORS 2009-04-25 19:49:27 +0000
185+++ AUTHORS 2010-05-21 18:17:28 +0000
186@@ -115,7 +115,7 @@
187 Pietro Cerutti
188
189 * FreeBSD port maintainer
190- * Contact: <gahr@gahr.ch> http://www.gahr.ch/FreeBSD/TuxGuitar
191+ * Contact: <gahr@gahr.ch> http://www.gahr.ch/
192
193 Facundo Corradini
194
195@@ -159,4 +159,12 @@
196
197 Xevi Noe i Nogueiras
198 * Catalan translation
199- * Contact: <xevi.noe@gmail.com>
200\ No newline at end of file
201+ * Contact: <xevi.noe@gmail.com>
202+
203+Jean-Pierre POULIN
204+ * Scales contributor
205+ * Contact: <jeanpierre.poulin@free.fr> http://www.jeanpierrepoulin.com/
206+
207+Lobo
208+ * Basque translation
209+ * Contact: <lobo1985guitarrista@hotmail.es> http://www.myspace.com/lobotheguitardude
210\ No newline at end of file
211
212=== modified file 'ChangeLog'
213--- ChangeLog 2009-04-25 19:49:27 +0000
214+++ ChangeLog 2010-05-21 18:17:28 +0000
215@@ -1,11 +1,17 @@
216-TuxGuitar 1.1 changes:
217+TuxGuitar 1.2 changes:
218
219-* Fix mixer bug
220-* Fix jre1.4 support bug
221-* 2 Voice support
222-* Chorus/Reverb/Phaser/Tremolo MIDI Controls
223-* Upstroke/Downstroke support
224-* Stems Up/Down/Auto support
225-* Display markers on the score
226-* Encoding option on GTP Plugin
227-* FTP Browser plugin now can run on non sun's JVM
228+* Fix some bugs
229+* Support measure range to loop
230+* Transpose notes feature
231+* Optionally transpose afected notes when change tuning
232+* Move beats left|right support
233+* More song properties options.
234+* Add multiple measure support
235+* Clean multiple measure support
236+* Number of pastes support
237+* Better lilypond plugin
238+* Better fluidsynth plugin
239+* New jack plugin
240+* New community integration plugin
241+* New cocoa integration plugin
242+* New audio unit plugin
243
244=== modified file 'Makefile'
245--- Makefile 2009-04-25 19:49:27 +0000
246+++ Makefile 2010-05-21 18:17:28 +0000
247@@ -15,9 +15,10 @@
248 ITEXT_JAR?=/usr/share/java/itext.jar
249
250 SWT_JAR?=$(shell echo ` \
251- ( t=/usr/share/java/swt-gtk-3.4.jar && test -r "$$t" && echo $$t ) \
252- || ( t=/usr/share/java/swt.jar && test -r "$$t" && echo $$t ) \
253+ ( t=/usr/share/java/swt.jar && test -r "$$t" && echo $$t ) \
254 || ( t=/usr/lib/java/swt.jar && test -r "$$t" && echo $$t ) \
255+ || ( t=/usr/lib/java/swt-gtk-3.5.1.jar && test -r "$$t" && echo $$t ) \
256+ || ( t=/usr/lib/java/swt-gtk-3.5.jar && test -r "$$t" && echo $$t ) \
257 || ( t=/etc/alternatives/swt.jar && test -r "$$t" && echo $$t ) \
258 ` )
259 SWT_PATH?=${SWT_JAR}
260@@ -47,7 +48,7 @@
261 TuxGuitar-jsa \
262 \
263 TuxGuitar-converter \
264-\
265+ TuxGuitar-community \
266 TuxGuitar-tuner \
267 #}subdirs
268
269@@ -55,15 +56,11 @@
270 TuxGuitar-alsa \
271 TuxGuitar-oss \
272 TuxGuitar-fluidsynth \
273+ TuxGuitar-jack \
274 #}subdirs_jni
275
276-subdirs_todo?=\
277- TuxGuitar-jws \
278- TuxGuitar-gervill \
279- #}
280-
281-#
282-export PACKAGE_JAR
283+#
284+export PACKAGE_JAR
285 ###
286
287 out_java?=\
288@@ -79,6 +76,7 @@
289 ./TuxGuitar-ptb/tuxguitar-ptb.jar \
290 ./TuxGuitar-musicxml/tuxguitar-musicxml.jar \
291 ./TuxGuitar-converter/tuxguitar-converter.jar \
292+ ./TuxGuitar-community/tuxguitar-community.jar \
293 ./TuxGuitar-tuner/tuxguitar-tuner.jar \
294 #}out_java
295
296@@ -87,7 +85,6 @@
297 out_sun?=\
298 TuxGuitar-library-ftp/tuxguitar-browser-ftp.jar \
299 TuxGuitar-library-http/tuxguitar-library-http.jar \
300- TuxGuitar-gervill/tuxguitar-gervill.jar \
301 #}out_sun
302
303 out_linux?=\
304@@ -97,6 +94,8 @@
305 ./TuxGuitar-oss/jni/libtuxguitar-oss-jni.so \
306 ./TuxGuitar-fluidsynth/tuxguitar-fluidsynth.jar \
307 ./TuxGuitar-fluidsynth/jni/libtuxguitar-fluidsynth-jni.so \
308+ ./TuxGuitar-jack/tuxguitar-jack.jar \
309+ ./TuxGuitar-jack/jni/libtuxguitar-jack-jni.so \
310 #}out_linux
311
312 out_windows?=TuxGuitar-winmm/tuxguitar-winmm.jar
313@@ -104,7 +103,7 @@
314 out_macos?=TuxGuitar-CoreAudio/tuxguitar-coreaudio.jar
315
316 #all?=${out_java} out_${JNI_OS} ${out_jsa} ${out_sun} # TODO
317-all?=${out_java} ${out_${JNI_OS}} ${out_jsa}
318+all?=${out_java} ${out_${JNI_OS}} ${out_jsa}
319
320 ###
321
322@@ -149,7 +148,7 @@
323
324 rebuild: clean fix build
325
326-all: ${all}
327+all: ${all}
328
329 all-java: ${out_java}
330
331@@ -191,6 +190,7 @@
332 # -install -m 755 ./TuxGuitar/${PACKAGE} ${INSTALL_BIN_DIR}/${PACKAGE}
333 -install -m 644 ${PACKAGE_JAR} ${INSTALL_JAR_DIR}/${PACKAGE}.jar
334 install -d ${INSTALL_BIN_DIR}
335+ mkdir -p ./TuxGuitar/share/plugins/
336 for t in ${subdirs} ; do cp $$t/*.jar ./TuxGuitar/share/plugins/ ; done
337 # -find . -iname "*.jar" -exec cp {} ./TuxGuitar/share/plugins/ \;
338 cp -rfa ./TuxGuitar/doc/* ${INSTALL_DOC_DIR}/
339@@ -216,15 +216,15 @@
340 find . -type l -exec rm -fv "{}" \;
341 rm -rf TuxGuitar/tmp
342
343-run: ${PACKAGE_EXEC}
344- cd ./TuxGuitar && APP_HOME=. ; ${SHELL} $<
345+run: ${PACKAGE_EXEC}
346+ cd ./TuxGuitar && APP_HOME=. ; ${SHELL} $<
347
348 test: ${PACKAGE_EXEC}
349 cd TuxGuitar && APP_HOME=. ; \
350 export PACKAGE_CLASSPATH="${PACKAGE_JAR}:." ;\
351 DEBUG=1 ${SHELL} $< --version
352
353-help:
354+help:
355 @echo "# JAVA_HOME=${JAVA_HOME}"
356 @echo "# JAVA=${JAVA}"
357 @echo "# JAVAC=${JAVAC}"
358@@ -243,14 +243,14 @@
359 dist tarball: snapshot
360
361
362-snapshot: ../${snapshot_dir}.tar.gz
363+snapshot: ../${snapshot_dir}.tar.gz
364
365 ../${snapshot_dir}.tar.gz: ../${snapshot_dir}
366 cd ${@D} && tar czf ${@F}.tar.gz \
367 --exclude="debian" \
368 ${@D}
369
370-release: ../${release_dir}.tar.gz
371+release: ../${release_dir}.tar.gz
372
373 ../${release_dir}.tar.gz: ../${release_dir}
374 cd ${@D} && tar czf ${@F}.tar.gz \
375
376=== added directory 'TuxGuitar-AudioUnit'
377=== added file 'TuxGuitar-AudioUnit/How to Install.txt'
378--- TuxGuitar-AudioUnit/How to Install.txt 1970-01-01 00:00:00 +0000
379+++ TuxGuitar-AudioUnit/How to Install.txt 2010-05-21 18:17:28 +0000
380@@ -0,0 +1,33 @@
381+* This plugin is for using the native Quicktime synthesizer in TuxGuitar on mac OS X.
382+
383+The provided prebuilt binaries will probably only work in 10.4, it may however be possible to build it on 10.3 (I am not sure)s
384+
385++------------------------------------+
386+| To install the provided binaries: |
387++------------------------------------+
388+
389+Right-click on 'TuxGuitar.app', choose 'Show Package Contents'
390+
391+copy file called 'tuxguitar-audiounit-jni.jnilib' into 'TuxGuitar.app/Contents/MacOS/'
392+copy file called 'tuxguitar-audiounit.jar' into 'TuxGuitar.app/Contents/MacOS/share/plugins/'
393+
394+open TuxGuitar
395+open menu 'Tools > Settings' and select midi port 'CoreAudio' in the 'Sound' section
396+
397++----------------------------------+
398+| To build the plugin from source |
399++----------------------------------+
400+
401+----------------------- Building TuxGuitar itself -----------------------
402+
403+get itext and swt libs, place them in a 'lib' folder
404+edit 'build.properties' to have mac settings and not linux settings
405+cd into TuxGuitar source
406+type 'ant'
407+
408+------------------------ CoreAudio plugin ---------------------
409+cd into TuxGuitar-CoreAudio
410+Open build.properties and edit it so it has the right path to the TuxGuitar directory where you built from source (from SVN checkout no edit necessary).
411+type 'ant'
412+
413+To install, follow above procedure.
414\ No newline at end of file
415
416=== added file 'TuxGuitar-AudioUnit/build.properties'
417--- TuxGuitar-AudioUnit/build.properties 1970-01-01 00:00:00 +0000
418+++ TuxGuitar-AudioUnit/build.properties 2010-05-21 18:17:28 +0000
419@@ -0,0 +1,7 @@
420+### ANT Flags
421+#
422+# build.compiler=gcj
423+ant.build.javac.source=1.4
424+ant.build.javac.target=1.4
425+
426+path.tuxguitar=../TuxGuitar/build
427
428=== added file 'TuxGuitar-AudioUnit/build.xml'
429--- TuxGuitar-AudioUnit/build.xml 1970-01-01 00:00:00 +0000
430+++ TuxGuitar-AudioUnit/build.xml 2010-05-21 18:17:28 +0000
431@@ -0,0 +1,66 @@
432+<?xml version="1.0" encoding="iso-8859-1"?>
433+
434+<project name="tuxguitar-audiounit" basedir="." default="all">
435+ <description>
436+ TuxGuitar audiounit
437+ </description>
438+
439+ <property file="build.properties" />
440+ <property name="build.src.path" value="src" />
441+ <property name="build.jni.path" value="jni" />
442+ <property name="build.path" value="build" />
443+ <property name="build.jar" value="tuxguitar-audiounit.jar" />
444+
445+ <property name="service.class" value="org.herac.tuxguitar.gui.system.plugins.TGPlugin" />
446+ <property name="service.provider" value="org.herac.tuxguitar.player.impl.midiport.audiounit.MidiPortReaderPlugin" />
447+
448+ <path id="class.path">
449+ <pathelement location="${path.tuxguitar}"/>
450+ <pathelement location="${path.swt}"/>
451+ </path >
452+
453+ <target name="init" depends="clean">
454+ <mkdir dir="${build.path}" />
455+ </target>
456+
457+ <target name="clean">
458+ <delete quiet="true" dir="${build.path}" />
459+ <delete quiet="true" file="${build.jar}" />
460+ </target>
461+
462+ <target name="build" depends="init">
463+
464+ <echo>+--------------------------------------------------------------------+</echo>
465+ <echo>| B U I L D I N G T U X G U I T A R - audiounit |</echo>
466+ <echo>+--------------------------------------------------------------------+</echo>
467+
468+ <javac srcdir="${build.src.path}" destdir="${build.path}" debug="false" >
469+ <classpath refid="class.path"/>
470+ <include name="**/*.java"/>
471+ </javac>
472+
473+ <mkdir dir="${build.path}/META-INF/services" />
474+ <echo file="${build.path}/META-INF/services/${service.class}" append="false">${service.provider}</echo>
475+
476+ <echo>+--------------------------------------------------------------------+</echo>
477+ <echo>| B U I L D I N G N A T I V E - L I B R A R I E S |</echo>
478+ <echo>+--------------------------------------------------------------------+</echo>
479+
480+ <exec dir="${build.jni.path}" executable="make" failonerror="yes" >
481+ <env key="JAVA_HOME" path="${java.home}/../"/>
482+ </exec>
483+
484+ <copy todir="${build.path}/../"><fileset file="${build.jni.path}/*.jnilib"/></copy>
485+ <chmod dir="${build.path}" perm="644" includes="*.jnilib"/>
486+ <exec dir="${build.jni.path}" executable="make" ><arg value="clean"/></exec>
487+
488+ <echo>+--------------------------------------------------------------------+</echo>
489+ <echo>| P A C K A G I N G T U X G U I T A R - AUDIOUNIT |</echo>
490+ <echo>+--------------------------------------------------------------------+</echo>
491+
492+ <jar destfile="${build.jar}" basedir="${build.path}" />
493+ <delete quiet="true" dir="${build.path}" />
494+ </target>
495+
496+ <target name="all" depends="build" />
497+</project>
498\ No newline at end of file
499
500=== added directory 'TuxGuitar-AudioUnit/jni'
501=== added file 'TuxGuitar-AudioUnit/jni/Makefile'
502--- TuxGuitar-AudioUnit/jni/Makefile 1970-01-01 00:00:00 +0000
503+++ TuxGuitar-AudioUnit/jni/Makefile 2010-05-21 18:17:28 +0000
504@@ -0,0 +1,26 @@
505+CXX = g++
506+
507+SDK = /Developer/SDKs/MacOSX10.5.sdk
508+SDK64 = /Developer/SDKs/MacOSX10.5.sdk
509+JAVA_FRAMEWORK = $(SDK)/System/Library/Frameworks/JavaVM.framework
510+JAVA_FRAMEWORK64 = $(SDK64)/System/Library/Frameworks/JavaVM.framework
511+
512+INCLUDES = -I $(JAVA_FRAMEWORK)/Headers/
513+INCLUDES64 = -I $(JAVA_FRAMEWORK64)/Headers/
514+
515+LIBRARIES = -framework CoreAudio -framework JavaVM -framework AudioUnit -framework AudioToolbox -framework CoreServices
516+
517+LIBRARY = libtuxguitar-audiounit-jni.jnilib
518+
519+FILENAME = org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.cpp
520+
521+all: $(LIBRARY)
522+
523+$(LIBRARY): clean
524+ g++ $(INCLUDES) -isysroot $(SDK) -arch ppc $(LIBRARIES) -msse -bundle -o ppc_$(LIBRARY) $(FILENAME)
525+ g++ $(INCLUDES) -isysroot $(SDK) -arch i386 $(LIBRARIES) -msse -bundle -o intel_$(LIBRARY) $(FILENAME)
526+ g++ $(INCLUDES64) -isysroot $(SDK64) -arch x86_64 $(LIBRARIES) -msse -bundle -o intel64_$(LIBRARY) $(FILENAME)
527+ lipo -create ppc_$(LIBRARY) intel_$(LIBRARY) intel64_$(LIBRARY) -output $(LIBRARY)
528+
529+clean:
530+ rm -f ppc_$(LIBRARY) intel_$(LIBRARY) intel64_$(LIBRARY) $(LIBRARY)
531\ No newline at end of file
532
533=== added file 'TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.cpp'
534--- TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.cpp 1970-01-01 00:00:00 +0000
535+++ TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.cpp 2010-05-21 18:17:28 +0000
536@@ -0,0 +1,335 @@
537+#include <stdio.h>
538+
539+#include "org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.h"
540+
541+#include <AudioUnit/AudioUnit.h>
542+#include <AudioToolbox/AudioToolbox.h>
543+
544+// some MIDI constants:
545+enum
546+{
547+ kMidiMessage_ControlChange = 0xB,
548+ kMidiMessage_ProgramChange = 0xC,
549+
550+ kMidiMessage_NoteOff = 0x8,
551+ kMidiMessage_NoteOn = 0x9,
552+ kMidiMessage_PitchBend = 0xE
553+};
554+
555+enum Controllers
556+{
557+ kController_BankMSBControl = 0,
558+ kController_BankLSBControl = 32,
559+};
560+
561+const int PITCH_BEND_LOWEST = 0;
562+const int PITCH_BEND_CENTER = 8192;
563+const int PITCH_BEND_HIGHEST = 16383;
564+
565+// Does not enforce the 'unsigned' aspect, this type only exists to make the calls clear what they expect
566+typedef char UInt7;
567+
568+class MidiPlayer
569+ {
570+ AUGraph graph;
571+ AudioUnit synthUnit;
572+ OSStatus result;
573+
574+ // ----------------------------------------------------------------------------------------
575+ /** Create the Graph and the Synth unit */
576+ OSStatus createAUGraph (AUGraph &outGraph, AudioUnit &outSynth)
577+ {
578+ OSStatus result;
579+ //create the nodes of the graph
580+ AUNode synthNode, limiterNode, outNode;
581+
582+ ComponentDescription cd;
583+ cd.componentManufacturer = kAudioUnitManufacturer_Apple;
584+ cd.componentFlags = 0;
585+ cd.componentFlagsMask = 0;
586+
587+ require_noerr (result = NewAUGraph (&outGraph), CreateAUGraph_home);
588+
589+ cd.componentType = kAudioUnitType_MusicDevice;
590+ cd.componentSubType = kAudioUnitSubType_DLSSynth;
591+
592+ require_noerr (result = AUGraphAddNode (outGraph, &cd, &synthNode), CreateAUGraph_home);
593+
594+ cd.componentType = kAudioUnitType_Effect;
595+ cd.componentSubType = kAudioUnitSubType_PeakLimiter;
596+
597+ require_noerr (result = AUGraphAddNode (outGraph, &cd, &limiterNode), CreateAUGraph_home);
598+
599+ cd.componentType = kAudioUnitType_Output;
600+ cd.componentSubType = kAudioUnitSubType_DefaultOutput;
601+ require_noerr (result = AUGraphAddNode (outGraph, &cd, &outNode), CreateAUGraph_home);
602+
603+ require_noerr (result = AUGraphOpen (outGraph), CreateAUGraph_home);
604+
605+ require_noerr (result = AUGraphConnectNodeInput (outGraph, synthNode, 0, limiterNode, 0), CreateAUGraph_home);
606+ require_noerr (result = AUGraphConnectNodeInput (outGraph, limiterNode, 0, outNode, 0), CreateAUGraph_home);
607+
608+ // ok we're good to go - get the Synth Unit...
609+ require_noerr (result = AUGraphNodeInfo(outGraph, synthNode, 0, &outSynth), CreateAUGraph_home);
610+
611+ CreateAUGraph_home:
612+ return result;
613+ }
614+
615+ public:
616+
617+ // ----------------------------------------------------------------------------------------
618+ MidiPlayer(char* bankPath = 0)
619+ {
620+ graph = 0;
621+ require_noerr (result = this->createAUGraph (graph, synthUnit), ctor_home);
622+
623+ // if the user supplies a sound bank, we'll set that before we initialize and start playing
624+ if (bankPath)
625+ {
626+ FSRef fsRef;
627+ require_noerr (result = FSPathMakeRef ((const UInt8*)bankPath, &fsRef, 0), ctor_home);
628+
629+ printf ("Setting Sound Bank:%s\n", bankPath);
630+
631+ require_noerr (result = AudioUnitSetProperty (synthUnit,
632+ kMusicDeviceProperty_SoundBankFSRef,
633+ kAudioUnitScope_Global, 0,
634+ &fsRef, sizeof(fsRef)), ctor_home);
635+
636+ }
637+
638+ // initialize and start the graph
639+ require_noerr (result = AUGraphInitialize (graph), ctor_home);
640+
641+ for (int n=0; n<15; n++)
642+ {
643+ this->programChange(0, n);
644+ this->setBank(n);
645+ }
646+
647+ // print out the graph so we can see what it looks like...
648+ //CAShow (graph);
649+
650+ require_noerr (result = AUGraphStart (graph), ctor_home);
651+ return;
652+
653+ ctor_home:
654+ fprintf(stderr, "Error in MidiPlayer::MidiPlayer\n");
655+
656+ }
657+
658+ // ----------------------------------------------------------------------------------------
659+ ~MidiPlayer()
660+ {
661+ if (graph)
662+ {
663+ AUGraphStop (graph);
664+ DisposeAUGraph (graph);
665+ }
666+ }
667+
668+ // ----------------------------------------------------------------------------------------
669+ /** Note on event */
670+ void noteOn(UInt32 noteNum, UInt32 onVelocity, UInt8 midiChannelInUse)
671+ {
672+ UInt32 noteOnCommand = kMidiMessage_NoteOn << 4 | midiChannelInUse;
673+ require_noerr (result = MusicDeviceMIDIEvent(synthUnit, noteOnCommand, noteNum, onVelocity, 0), home_note_on);
674+
675+ return;
676+
677+ home_note_on:
678+ fprintf(stderr, "Error in MidiPlayer::noteOn\n");
679+ }
680+
681+ // ----------------------------------------------------------------------------------------
682+ /** Note off event */
683+ void noteOff(UInt32 noteNum, UInt8 midiChannelInUse)
684+ {
685+ UInt32 noteOffCommand = kMidiMessage_NoteOn << 4 | midiChannelInUse;
686+ require_noerr (result = MusicDeviceMIDIEvent(synthUnit, noteOffCommand, noteNum, 0, 0), home_note_off);
687+
688+ return;
689+
690+ home_note_off:
691+ fprintf(stderr, "Error in MidiPlayer::noteOff\n");
692+ }
693+
694+ // ----------------------------------------------------------------------------------------
695+ /** Program change event */
696+ void programChange(UInt8 progChangeNum, UInt8 midiChannelInUse)
697+ {
698+ require_noerr (result = MusicDeviceMIDIEvent(synthUnit,
699+ kMidiMessage_ProgramChange << 4 | midiChannelInUse,
700+ progChangeNum, 0,
701+ 0 /*sample offset*/), home_programChange);
702+ return;
703+ home_programChange:
704+ fprintf(stderr, "Error in MidiPlayer::programChange\n");
705+ }
706+
707+ // ----------------------------------------------------------------------------------------
708+ /** Bank set event */
709+ void setBank(UInt8 midiChannelInUse)
710+ {
711+ require_noerr (result = MusicDeviceMIDIEvent(synthUnit,
712+ kMidiMessage_ControlChange << 4 | midiChannelInUse,
713+ kController_BankMSBControl, 0,
714+ 0 /*sample offset*/), home_setBank);
715+ return;
716+ home_setBank:
717+ fprintf(stderr, "Error in MidiPlayer::setBank\n");
718+ }
719+
720+ // ----------------------------------------------------------------------------------------
721+ /** Control Event */
722+ void controlEvent(UInt8 controller, UInt7 value, UInt8 midiChannelInUse)
723+ {
724+ require_noerr (result = MusicDeviceMIDIEvent(synthUnit,
725+ kMidiMessage_ControlChange << 4 | midiChannelInUse,
726+ controller, value,
727+ 0 /*sample offset*/), home_setBank);
728+ return;
729+ home_setBank:
730+ fprintf(stderr, "Error in MidiPlayer::setBank\n");
731+ }
732+
733+ // ----------------------------------------------------------------------------------------
734+ /** Pitch Bend Event */
735+ void pitchBend(UInt7 lsb_value, UInt7 msb_value, UInt8 midiChannelInUse)
736+ {
737+ require_noerr (result = MusicDeviceMIDIEvent(synthUnit,
738+ kMidiMessage_PitchBend << 4 | midiChannelInUse,
739+ lsb_value, msb_value,
740+ 0 /*sample offset*/), home_setBank);
741+ return;
742+ home_setBank:
743+ fprintf(stderr, "Error in MidiPlayer::setBank\n");
744+ }
745+
746+ // ----------------------------------------------------------------------------------------
747+ /** Easier Pitch Bend Event
748+ * \param relative_value Ranging from -2 to 2, where 0 means no pitch change, -2 is two half-steps lower, etc.
749+ */
750+ void pitchBend(float relative_value, UInt8 midiChannelInUse)
751+ {
752+ int converted_value = PITCH_BEND_CENTER;
753+
754+ if (relative_value < -2.0f || relative_value > 2.0f)
755+ {
756+ fprintf(stderr, "Pitch event cannot handle %f\n", relative_value);
757+ }
758+
759+ if (relative_value != 0.0f)
760+ {
761+ converted_value = PITCH_BEND_CENTER + relative_value*(PITCH_BEND_HIGHEST - PITCH_BEND_LOWEST);
762+
763+ if (converted_value < PITCH_BEND_LOWEST) converted_value = PITCH_BEND_LOWEST;
764+ else if (converted_value > PITCH_BEND_HIGHEST) converted_value = PITCH_BEND_HIGHEST;
765+ }
766+
767+ UInt7 lsb = converted_value & 0x7F; // extract the 7 least significant bytes
768+ UInt7 msb = (converted_value >> 7) & 0x7F; // extract the 7 most significant bytes
769+
770+ pitchBend(lsb, msb, midiChannelInUse);
771+
772+ }
773+
774+ };
775+
776+
777+// ----------------------------------------------------------------------------------------
778+// ----------------------------------------------------------------------------------------
779+
780+MidiPlayer* player;
781+
782+void init()
783+{
784+ player = new MidiPlayer();
785+}
786+
787+void free()
788+{
789+ delete player;
790+}
791+
792+void programChange(int channel, int instrument)
793+{
794+ player->programChange(instrument, channel);
795+}
796+
797+void controlChange(int channel, int controller, int value)
798+{
799+ player->controlEvent(controller, value, channel);
800+}
801+
802+void pitchBend(int channel, short value)
803+{
804+ value *= 128; // tg has the center at 64, but audiounit at 8192
805+ UInt7 lsb = value & 0x7F; // extract the 7 least significant bytes
806+ UInt7 msb = (value >> 7) & 0x7F; // extract the 7 most significant bytes
807+ player->pitchBend(lsb, msb, channel);
808+}
809+
810+void noteOn(int pitchID, int volume, int channel)
811+{
812+ player->noteOn(pitchID, volume, channel);
813+}
814+
815+void noteOff(int pitchID, int volume, int channel)
816+{
817+ player->noteOff(pitchID, channel);
818+
819+}
820+
821+/* -------------------------------------------------------------------------------------------------------------------------------- */
822+
823+/* open port */
824+
825+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_open(JNIEnv* env, jobject obj)
826+{
827+
828+}
829+
830+/* close port */
831+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_close(JNIEnv* env, jobject obj)
832+{
833+
834+}
835+
836+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_openDevice(JNIEnv* env, jobject obj)
837+{
838+ init();
839+}
840+
841+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_closeDevice(JNIEnv* env, jobject obj)
842+{
843+ free();
844+}
845+
846+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_noteOn(JNIEnv* env, jobject ojb, jint channel, jint note, jint velocity)
847+{
848+
849+ noteOn(note, velocity, channel);
850+}
851+
852+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_noteOff(JNIEnv* env, jobject ojb, jint channel, jint note, jint velocity)
853+{
854+ noteOff(note, velocity, channel);
855+}
856+
857+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_programChange(JNIEnv* env, jobject ojb, jint channel, jint program)
858+{
859+ programChange(channel, program);
860+}
861+
862+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_controlChange(JNIEnv* env, jobject ojb, jint channel, jint control, jint value)
863+{
864+ controlChange(channel, control, value);
865+}
866+
867+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_pitchBend(JNIEnv* env, jobject ojb, jint channel, jint value)
868+{
869+ pitchBend(channel, value);
870+
871+}
872
873=== added file 'TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.h'
874--- TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.h 1970-01-01 00:00:00 +0000
875+++ TuxGuitar-AudioUnit/jni/org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI.h 2010-05-21 18:17:28 +0000
876@@ -0,0 +1,85 @@
877+/* DO NOT EDIT THIS FILE - it is machine generated */
878+#include <JavaVM/jni.h>
879+/* Header for class org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI */
880+
881+#ifndef _Included_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI
882+#define _Included_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI
883+#ifdef __cplusplus
884+extern "C" {
885+#endif
886+/*
887+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
888+ * Method: open
889+ * Signature: ()V
890+ */
891+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_open
892+ (JNIEnv *, jobject);
893+
894+/*
895+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
896+ * Method: close
897+ * Signature: ()V
898+ */
899+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_close
900+ (JNIEnv *, jobject);
901+
902+/*
903+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
904+ * Method: openDevice
905+ * Signature: (II)V
906+ */
907+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_openDevice
908+ (JNIEnv *, jobject);
909+
910+/*
911+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
912+ * Method: closeDevice
913+ * Signature: ()V
914+ */
915+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_closeDevice
916+ (JNIEnv *, jobject);
917+
918+/*
919+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
920+ * Method: noteOn
921+ * Signature: (III)V
922+ */
923+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_noteOn
924+ (JNIEnv *, jobject, jint, jint, jint);
925+
926+/*
927+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
928+ * Method: noteOff
929+ * Signature: (III)V
930+ */
931+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_noteOff
932+ (JNIEnv *, jobject, jint, jint, jint);
933+
934+/*
935+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
936+ * Method: controlChange
937+ * Signature: (III)V
938+ */
939+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_controlChange
940+ (JNIEnv *, jobject, jint, jint, jint);
941+
942+/*
943+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
944+ * Method: programChange
945+ * Signature: (II)V
946+ */
947+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_programChange
948+ (JNIEnv *, jobject, jint, jint);
949+
950+/*
951+ * Class: org_herac_tuxguitar_player_impl_midiport_alsa_MidiReceiverJNI
952+ * Method: pitchBend
953+ * Signature: (II)V
954+ */
955+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_audiounit_MidiReceiverJNI_pitchBend
956+ (JNIEnv *, jobject, jint, jint);
957+
958+#ifdef __cplusplus
959+}
960+#endif
961+#endif
962
963=== added directory 'TuxGuitar-AudioUnit/src'
964=== added directory 'TuxGuitar-AudioUnit/src/org'
965=== added directory 'TuxGuitar-AudioUnit/src/org/herac'
966=== added directory 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar'
967=== added directory 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player'
968=== added directory 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl'
969=== added directory 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport'
970=== added directory 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit'
971=== added file 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/JNILibraryLoader.java'
972--- TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/JNILibraryLoader.java 1970-01-01 00:00:00 +0000
973+++ TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/JNILibraryLoader.java 2010-05-21 18:17:28 +0000
974@@ -0,0 +1,65 @@
975+package org.herac.tuxguitar.player.impl.midiport.audiounit;
976+
977+import java.io.File;
978+
979+public class JNILibraryLoader {
980+
981+ private static final String JNI_EXTENSION = ".jnilib";
982+
983+ //private static final String JNI_TMP_PATH = (System.getProperty( "java.io.tmpdir" ) + File.separator);
984+
985+ public static void loadLibrary(String libname){
986+ System.out.println("trying to load" + libname + " (void loadLibrary)");
987+ JNILibraryLoader.loadFromClassPath(libname + JNI_EXTENSION);
988+ /*
989+ if(!JNILibraryLoader.loadFromClassPath(libname + JNI_EXTENSION)){
990+ //System.loadLibrary(libname);
991+ }
992+ */
993+ }
994+
995+ private static boolean loadFromClassPath(String filename){
996+ System.out.println("trying to load" + filename + " (bool loadFromClassPath)");
997+
998+ File file = new File(/*JNI_TMP_PATH +*/ filename);
999+ /*
1000+ try{
1001+ if(!file.exists()){
1002+ OutputStream outputStream = new FileOutputStream(file);
1003+ InputStream inputStream = JNILibraryLoader.class.getClassLoader().getResourceAsStream(filename);
1004+ if (inputStream != null) {
1005+ int read;
1006+ byte [] buffer = new byte [4096];
1007+ while ((read = inputStream.read (buffer)) != -1) {
1008+ outputStream.write(buffer, 0, read);
1009+ }
1010+ outputStream.close();
1011+ inputStream.close();
1012+ }
1013+ }
1014+ */
1015+ if(file.exists()){
1016+ System.out.println("calling file.getAbsolutePath() : "+ file.getAbsolutePath());
1017+ System.load(file.getAbsolutePath());
1018+ //System.load(file.getAbsolutePath());
1019+ return true;
1020+ }
1021+ //else
1022+ //{
1023+ System.out.println("Can't find file " + file.getAbsolutePath());
1024+ return false;
1025+ //}
1026+ /*
1027+ }catch(Throwable throwable){
1028+ return false;
1029+ }finally{
1030+ if(file.exists()){
1031+ file.delete();
1032+ }
1033+ }
1034+ return false;
1035+ */
1036+ }
1037+}
1038+
1039+
1040
1041=== added file 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortImpl.java'
1042--- TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortImpl.java 1970-01-01 00:00:00 +0000
1043+++ TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortImpl.java 2010-05-21 18:17:28 +0000
1044@@ -0,0 +1,44 @@
1045+package org.herac.tuxguitar.player.impl.midiport.audiounit;
1046+
1047+import org.herac.tuxguitar.player.base.MidiOutputPort;
1048+import org.herac.tuxguitar.player.base.MidiReceiver;
1049+
1050+public class MidiPortImpl implements MidiOutputPort{
1051+
1052+ private String key;
1053+ private String name;
1054+ private MidiReceiverImpl receiver;
1055+
1056+ public MidiPortImpl(MidiReceiverImpl midiOut,String name,String key){
1057+ this.key = key;
1058+ this.name = name;
1059+ this.receiver = midiOut;
1060+ }
1061+
1062+ public void open(){
1063+ if(!this.receiver.isConnected()){
1064+ this.receiver.connect();
1065+ }
1066+ }
1067+
1068+ public void close(){
1069+ this.receiver.disconnect();
1070+ }
1071+
1072+ public MidiReceiver getReceiver(){
1073+ this.open();
1074+ return this.receiver;
1075+ }
1076+
1077+ public void check(){
1078+ // Not implemented
1079+ }
1080+
1081+ public String getKey(){
1082+ return this.key;
1083+ }
1084+
1085+ public String getName(){
1086+ return this.name;
1087+ }
1088+}
1089\ No newline at end of file
1090
1091=== added file 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderAudioUnit.java'
1092--- TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderAudioUnit.java 1970-01-01 00:00:00 +0000
1093+++ TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderAudioUnit.java 2010-05-21 18:17:28 +0000
1094@@ -0,0 +1,27 @@
1095+package org.herac.tuxguitar.player.impl.midiport.audiounit;
1096+
1097+import java.util.List;
1098+
1099+import org.herac.tuxguitar.player.base.MidiOutputPortProvider;
1100+import org.herac.tuxguitar.player.impl.midiport.audiounit.MidiReceiverImpl;
1101+
1102+public class MidiPortReaderAudioUnit implements MidiOutputPortProvider{
1103+
1104+ private static final MidiReceiverImpl midiOut = new MidiReceiverImpl();
1105+
1106+ public MidiPortReaderAudioUnit(){
1107+ super();
1108+ }
1109+
1110+ public List listPorts() {
1111+ if(!midiOut.isOpen()){
1112+ midiOut.open();
1113+ }
1114+ return midiOut.listPorts();
1115+ }
1116+
1117+ public void closeAll(){
1118+ midiOut.close();
1119+ }
1120+
1121+}
1122
1123=== added file 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderPlugin.java'
1124--- TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderPlugin.java 1970-01-01 00:00:00 +0000
1125+++ TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiPortReaderPlugin.java 2010-05-21 18:17:28 +0000
1126@@ -0,0 +1,28 @@
1127+package org.herac.tuxguitar.player.impl.midiport.audiounit;
1128+
1129+import org.herac.tuxguitar.gui.system.plugins.base.TGMidiOutputPortProviderPlugin;
1130+import org.herac.tuxguitar.player.base.MidiOutputPortProvider;
1131+
1132+public class MidiPortReaderPlugin extends TGMidiOutputPortProviderPlugin{
1133+
1134+ protected MidiOutputPortProvider getProvider() {
1135+ return new MidiPortReaderAudioUnit();
1136+ }
1137+
1138+ public String getAuthor() {
1139+ return "Auria";
1140+ }
1141+
1142+ public String getDescription() {
1143+ return "Core Audio output plugin";
1144+ }
1145+
1146+ public String getName() {
1147+ return "Core Audio output plugin";
1148+ }
1149+
1150+ public String getVersion() {
1151+ return "1.0";
1152+ }
1153+
1154+}
1155
1156=== added file 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverImpl.java'
1157--- TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverImpl.java 1970-01-01 00:00:00 +0000
1158+++ TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverImpl.java 2010-05-21 18:17:28 +0000
1159@@ -0,0 +1,107 @@
1160+package org.herac.tuxguitar.player.impl.midiport.audiounit;
1161+
1162+import java.util.ArrayList;
1163+import java.util.Collections;
1164+import java.util.List;
1165+
1166+import org.herac.tuxguitar.player.base.MidiControllers;
1167+import org.herac.tuxguitar.player.base.MidiReceiver;
1168+
1169+public class MidiReceiverImpl extends MidiReceiverJNI implements MidiReceiver{
1170+ private boolean open; // unncessary
1171+ private boolean connected;
1172+ private List ports;
1173+
1174+ public MidiReceiverImpl(){
1175+ this.ports = new ArrayList();
1176+ this.connected = false;
1177+ }
1178+
1179+ public void open(){
1180+ super.open();
1181+ this.open = true;
1182+ }
1183+
1184+ public void close(){
1185+ if(this.isOpen()){
1186+ this.disconnect();
1187+ super.close();
1188+ this.open = false;
1189+ }
1190+ }
1191+
1192+ public boolean isOpen(){
1193+ return (this.open);
1194+ }
1195+
1196+ public boolean isConnected(){
1197+ return (this.isOpen() && this.connected);
1198+ }
1199+
1200+ public void connect(){
1201+ if(isOpen()){
1202+ if(!isConnected()){
1203+ this.connected = true;
1204+ this.openDevice();
1205+ }
1206+ }
1207+ }
1208+
1209+ public void disconnect() {
1210+ if(isConnected()){
1211+ this.closeDevice();
1212+ this.connected = false;
1213+ }
1214+ }
1215+
1216+ public List listPorts(){
1217+ if(isOpen()){
1218+ this.ports.clear();
1219+ this.ports.add(new MidiPortImpl(this, "AudioUnit graph midi playback" , "audiounit" ));
1220+ return this.ports;
1221+ }
1222+ return Collections.EMPTY_LIST;
1223+ }
1224+
1225+ public void sendSystemReset() {
1226+ if(isOpen()){
1227+ //not implemented
1228+ }
1229+ }
1230+
1231+ public void sendAllNotesOff() {
1232+ for(int i = 0; i < 16; i ++){
1233+ sendControlChange(i,MidiControllers.ALL_NOTES_OFF,0);
1234+ }
1235+ }
1236+
1237+ public void sendControlChange(int channel, int controller, int value) {
1238+ if(isOpen()){
1239+ super.controlChange(channel, controller, value);
1240+ }
1241+ }
1242+
1243+ public void sendNoteOff(int channel, int key, int velocity) {
1244+ if(isOpen()){
1245+ super.noteOff(channel, key, velocity);
1246+ }
1247+ }
1248+
1249+ public void sendNoteOn(int channel, int key, int velocity) {
1250+ if(isOpen()){
1251+ super.noteOn(channel, key, velocity);
1252+ }
1253+ }
1254+
1255+ public void sendPitchBend(int channel, int value) {
1256+ if(isOpen()){
1257+ super.pitchBend(channel, value);
1258+ }
1259+ }
1260+
1261+ public void sendProgramChange(int channel, int value) {
1262+ if(isOpen()){
1263+ super.programChange(channel, value);
1264+ }
1265+ }
1266+}
1267
1268=== added file 'TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverJNI.java'
1269--- TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverJNI.java 1970-01-01 00:00:00 +0000
1270+++ TuxGuitar-AudioUnit/src/org/herac/tuxguitar/player/impl/midiport/audiounit/MidiReceiverJNI.java 2010-05-21 18:17:28 +0000
1271@@ -0,0 +1,37 @@
1272+package org.herac.tuxguitar.player.impl.midiport.audiounit;
1273+
1274+public abstract class MidiReceiverJNI{
1275+
1276+ private static final String JNI_LIBRARY_NAME = new String("tuxguitar-audiounit-jni");
1277+
1278+ static{
1279+ System.loadLibrary (JNI_LIBRARY_NAME);
1280+ }
1281+
1282+ public MidiReceiverJNI() {
1283+ super();
1284+ }
1285+
1286+ protected native void open();
1287+
1288+ protected native void close();
1289+
1290+ //protected native void findDevices();
1291+
1292+ protected native void openDevice();
1293+
1294+ protected native void closeDevice();
1295+
1296+ protected native void noteOn(int channel,int note,int velocity);
1297+
1298+ protected native void noteOff(int channel,int note,int velocity);
1299+
1300+ protected native void controlChange(int channel,int control,int value);
1301+
1302+ protected native void programChange(int channel,int program);
1303+
1304+ protected native void pitchBend(int channel,int value);
1305+
1306+
1307+ //protected abstract void addDevice(String name);
1308+}
1309
1310=== added file 'TuxGuitar-CoreAudio/How to Install.txt'
1311--- TuxGuitar-CoreAudio/How to Install.txt 1970-01-01 00:00:00 +0000
1312+++ TuxGuitar-CoreAudio/How to Install.txt 2010-05-21 18:17:28 +0000
1313@@ -0,0 +1,33 @@
1314+* This plugin is for using the native Quicktime synthesizer in TuxGuitar on mac OS X. It requires a version of TuxGuitar 0.9 or better (CVS).
1315+
1316+The provided prebuilt binaries will probably only work in 10.4, it may however be possible to build it on 10.3 (I am not sure)
1317+
1318++------------------------------------+
1319+| To install the provided binaries: |
1320++------------------------------------+
1321+
1322+Right-click on 'TuxGuitar.app', choose 'Show Package Contents'
1323+
1324+copy file called 'tuxguitar-coreaudio-jni.jnilib' into 'TuxGuitar.app/Contents/MacOS/'
1325+copy file called 'tuxguitar-coreaudio.jar' into 'TuxGuitar.app/Contents/MacOS/share/plugins/'
1326+
1327+open TuxGuitar
1328+open menu 'Tools > Settings' and select midi port 'CoreAudio' in the 'Sound' section
1329+
1330++----------------------------------+
1331+| To build the plugin from source |
1332++----------------------------------+
1333+
1334+----------------------- Building TuxGuitar itself -----------------------
1335+
1336+get itext and swt libs, place them in a 'lib' folder
1337+edit 'build.properties' to have mac settings and not linux settings
1338+cd into TuxGuitar source
1339+type 'ant'
1340+
1341+------------------------ CoreAudio plugin ---------------------
1342+cd into TuxGuitar-CoreAudio
1343+Open build.properties and edit it so it has the right path to the TuxGuitar directory where you built from source (from SVN checkout no edit necessary).
1344+type 'ant'
1345+
1346+To install, follow above procedure.
1347\ No newline at end of file
1348
1349=== modified file 'TuxGuitar-CoreAudio/build.properties'
1350--- TuxGuitar-CoreAudio/build.properties 2008-06-19 00:30:30 +0000
1351+++ TuxGuitar-CoreAudio/build.properties 2010-05-21 18:17:28 +0000
1352@@ -4,4 +4,4 @@
1353 ant.build.javac.source=1.4
1354 ant.build.javac.target=1.4
1355
1356-path.tuxguitar=../TuxGuitar/build
1357\ No newline at end of file
1358+path.tuxguitar=../TuxGuitar/build
1359
1360=== modified file 'TuxGuitar-CoreAudio/src/org/herac/tuxguitar/player/impl/midiport/coreaudio/MidiPortImpl.java'
1361--- TuxGuitar-CoreAudio/src/org/herac/tuxguitar/player/impl/midiport/coreaudio/MidiPortImpl.java 2009-04-25 19:49:27 +0000
1362+++ TuxGuitar-CoreAudio/src/org/herac/tuxguitar/player/impl/midiport/coreaudio/MidiPortImpl.java 2010-05-21 18:17:28 +0000
1363@@ -3,12 +3,15 @@
1364 import org.herac.tuxguitar.player.base.MidiOutputPort;
1365 import org.herac.tuxguitar.player.base.MidiReceiver;
1366
1367-public class MidiPortImpl extends MidiOutputPort{
1368+public class MidiPortImpl implements MidiOutputPort{
1369
1370- private final MidiReceiverImpl receiver;
1371+ private String key;
1372+ private String name;
1373+ private MidiReceiverImpl receiver;
1374
1375 public MidiPortImpl(MidiReceiverImpl midiOut,String name,String key){
1376- super(key,name);
1377+ this.key = key;
1378+ this.name = name;
1379 this.receiver = midiOut;
1380 }
1381
1382@@ -30,4 +33,12 @@
1383 public void check(){
1384 // Not implemented
1385 }
1386+
1387+ public String getKey(){
1388+ return this.key;
1389+ }
1390+
1391+ public String getName(){
1392+ return this.name;
1393+ }
1394 }
1395\ No newline at end of file
1396
1397=== modified file 'TuxGuitar-alsa/GNUmakefile'
1398--- TuxGuitar-alsa/GNUmakefile 2009-04-25 19:49:27 +0000
1399+++ TuxGuitar-alsa/GNUmakefile 2010-05-21 18:17:28 +0000
1400@@ -5,8 +5,8 @@
1401 #licence: LGPL
1402 #------------------------------------------------------------------------------
1403 PACKAGE?=tuxguitar-alsa
1404-LIBRARY?=lib${PACKAGE}.so
1405-LIBRARY_JNI?=lib${PACKAGE}-jni.so
1406+LIBRARY?=lib$(PACKAGE).so
1407+LIBRARY_JNI?=lib$(PACKAGE)-jni.so
1408 LIBRARY_PROVIDER?=org.herac.tuxguitar.player.impl.midiport.alsa.MidiOutputPortProviderPlugin
1409
1410 PREFIX?=/usr
1411@@ -16,31 +16,30 @@
1412
1413 # tuxguitar paths
1414 TG_SERVICE_CLASS?=org.herac.tuxguitar.gui.system.plugins.TGPlugin
1415-TG_PREFIX?=${PREFIX}
1416-TG_SOURCE_PATH?=${TG_PREFIX}/src
1417-TG_LIBRARY_PATH?=${TG_PREFIX}/lib
1418-TG_LIBRARY_PATH_JNI?=${TG_PREFIX}/lib/jni
1419-TG_NATIVE_PLUGINS_PATH?=${TG_PREFIX}/share/tuxguitar/plugins
1420+TG_PREFIX?=$(PREFIX)
1421+TG_SOURCE_PATH?=$(TG_PREFIX)/src
1422+TG_LIBRARY_PATH?=$(TG_PREFIX)/lib
1423+TG_LIBRARY_PATH_JNI?=$(TG_PREFIX)/lib/jni
1424+TG_NATIVE_PLUGINS_PATH?=$(TG_PREFIX)/share/tuxguitar/plugins
1425
1426 # install paths
1427-INSTALL_LIBRARY_JNI_DIR?=${TG_LIBRARY_PATH_JNI}
1428-INSTALL_LIBRARY_DIR?=${TG_NATIVE_PLUGINS_PATH}
1429-INSTALL_SERVICE_DIR?=${TG_NATIVE_PLUGINS_PATH}/${PACKAGE}/META-INF/services
1430+INSTALL_LIBRARY_JNI_DIR?=$(TG_LIBRARY_PATH_JNI)
1431+INSTALL_LIBRARY_DIR?=$(TG_NATIVE_PLUGINS_PATH)
1432+INSTALL_SERVICE_DIR?=$(TG_NATIVE_PLUGINS_PATH)/$(PACKAGE)/META-INF/services
1433
1434 # build paths
1435 JAVA_SOURCE_PATH?=./src/
1436-JAVA_SOURCES?=$(shell find ${JAVA_SOURCE_PATH} -name "*.java")
1437-JAVA_OBJECTS?=${JAVA_SOURCES:%.java=%.o}
1438+JAVA_SOURCES?=$(shell find $(JAVA_SOURCE_PATH) -name "*.java")
1439+JAVA_OBJECTS?=$(PACKAGE).o
1440 JNI_SOURCE_PATH?=./jni/
1441-JNI_SOURCES?=$(shell find ${JNI_SOURCE_PATH} -name "*.c")
1442-JNI_OBJECTS?=${JNI_SOURCES:%.c=%.o}
1443+JNI_SOURCES?=$(shell find $(JNI_SOURCE_PATH) -name "*.c")
1444+JNI_OBJECTS?=$(JNI_SOURCES:%.c=%.o)
1445
1446 GCJ?=gcj
1447-GCJFLAGS+=-fjni -I${JAVA_SOURCE_PATH} -I${TG_SOURCE_PATH} -I${SWT_PATH}
1448+GCJFLAGS+=-fjni -I$(JAVA_SOURCE_PATH) -I$(TG_SOURCE_PATH) -I$(SWT_PATH)
1449
1450 CC=gcc
1451-CFLAGS=-fPIC -I $(shell ${GCJ} -print-file-name=include/)
1452-
1453+CFLAGS=-fPIC -I $(shell $(GCJ) -print-file-name=include/)
1454
1455 default: all
1456
1457@@ -48,46 +47,46 @@
1458
1459 objects: tmp.classes.tmp
1460
1461-tmp.classes.tmp: ${JAVA_OBJECTS}
1462+tmp.classes.tmp: $(JAVA_OBJECTS)
1463 @touch $@
1464
1465-library: ${LIBRARY}
1466+library: $(LIBRARY)
1467
1468-library_jni: ${LIBRARY_JNI}
1469+library_jni: $(LIBRARY_JNI)
1470
1471 install:
1472- -install -d $(DESTDIR)${PREFIX}/
1473- -install -d $(DESTDIR)${INSTALL_LIBRARY_DIR}/
1474- -install -d $(DESTDIR)${INSTALL_LIBRARY_JNI_DIR}/
1475- -install -d $(DESTDIR)${INSTALL_SERVICE_DIR}/
1476- -install ${LIBRARY} $(DESTDIR)${INSTALL_LIBRARY_DIR}/${LIBRARY}
1477- -install ${LIBRARY_JNI} $(DESTDIR)${INSTALL_LIBRARY_JNI_DIR}/${LIBRARY_JNI}
1478- -install ${TG_SERVICE_CLASS} $(DESTDIR)${INSTALL_SERVICE_DIR}/${TG_SERVICE_CLASS}
1479+ -install -d $(DESTDIR)$(PREFIX)/
1480+ -install -d $(DESTDIR)$(INSTALL_LIBRARY_DIR)/
1481+ -install -d $(DESTDIR)$(INSTALL_LIBRARY_JNI_DIR)/
1482+ -install -d $(DESTDIR)$(INSTALL_SERVICE_DIR)/
1483+ -install $(LIBRARY) $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
1484+ -install $(LIBRARY_JNI) $(DESTDIR)$(INSTALL_LIBRARY_JNI_DIR)/$(LIBRARY_JNI)
1485+ -install $(TG_SERVICE_CLASS) $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
1486
1487 uninstall:
1488- -rm $(DESTDIR)${INSTALL_LIBRARY_DIR}/${LIBRARY}
1489- -rm $(DESTDIR)${INSTALL_LIBRARY_JNI_DIR}/${LIBRARY_JNI}
1490- -rm $(DESTDIR)${INSTALL_SERVICE_DIR}/${TG_SERVICE_CLASS}
1491+ -rm $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
1492+ -rm $(DESTDIR)$(INSTALL_LIBRARY_JNI_DIR)/$(LIBRARY_JNI)
1493+ -rm $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
1494
1495 clean:
1496 -@find . -name "*.o" -exec rm -f {} \; > /dev/null 2>&1
1497 -@find . -name "*.so" -exec rm -f {} \; > /dev/null 2>&1
1498 -@find . -name "*.tmp" -exec rm -f {} \; > /dev/null 2>&1
1499- -@rm ${TG_SERVICE_CLASS}
1500-
1501-%.o: %.java
1502- ${GCJ} ${GCJFLAGS} -c -o $@ $<
1503+ -@rm $(TG_SERVICE_CLASS)
1504
1505 %.o: %.c
1506- ${CC} ${CFLAGS} -c -o $@ $<
1507-
1508-%.so: ${JAVA_OBJECTS}
1509- ${GCJ} -shared -o $@ -ltuxguitar -L${TG_LIBRARY_PATH} $^
1510-
1511-${LIBRARY_JNI}: ${JNI_OBJECTS}
1512- ${GCJ} -shared -o $@ -lasound -lpthread $^
1513+ $(CC) $(CFLAGS) -c -o $(@F) $<
1514+
1515+$(PACKAGE).o: $(JAVA_SOURCES)
1516+ $(GCJ) $(GCJFLAGS) -c -o $(@F) $^
1517+
1518+$(LIBRARY): $(JAVA_OBJECTS)
1519+ ${GCJ} -shared -o $@ -ltuxguitar -L$(TG_LIBRARY_PATH) $(^F)
1520+
1521+$(LIBRARY_JNI): $(JNI_OBJECTS)
1522+ $(GCJ) -shared -o $@ -lasound -lpthread $(^F)
1523
1524 meta-inf:
1525- echo ${LIBRARY_PROVIDER} > ${TG_SERVICE_CLASS}
1526+ echo $(LIBRARY_PROVIDER) > $(TG_SERVICE_CLASS)
1527
1528 #eof "$Id: GNUmakefile,v 1.10 2008/04/17 20:06:34 rzr Exp $"
1529
1530=== modified file 'TuxGuitar-alsa/build.properties'
1531--- TuxGuitar-alsa/build.properties 2008-06-19 00:30:30 +0000
1532+++ TuxGuitar-alsa/build.properties 2010-05-21 18:17:28 +0000
1533@@ -4,4 +4,4 @@
1534 ant.build.javac.source=1.4
1535 ant.build.javac.target=1.4
1536
1537-path.tuxguitar=../TuxGuitar/build
1538\ No newline at end of file
1539+path.tuxguitar=../TuxGuitar/build
1540
1541=== modified file 'TuxGuitar-alsa/jni/org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem.c'
1542--- TuxGuitar-alsa/jni/org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem.c 2009-04-25 19:49:27 +0000
1543+++ TuxGuitar-alsa/jni/org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem.c 2010-05-21 18:17:28 +0000
1544@@ -120,7 +120,7 @@
1545 }
1546 }
1547
1548-JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_noteOn(JNIEnv* env, jobject ojb, jlong ptr, jint channel, jint note, jint velocity)
1549+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_noteOn(JNIEnv* env, jobject obj, jlong ptr, jint channel, jint note, jint velocity)
1550 {
1551 handle_t *handle = NULL;
1552 memcpy(&handle, &ptr, sizeof(handle));
1553@@ -137,7 +137,7 @@
1554 }
1555 }
1556
1557-JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_noteOff(JNIEnv* env, jobject ojb, jlong ptr, jint channel, jint note, jint velocity)
1558+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_noteOff(JNIEnv* env, jobject obj, jlong ptr, jint channel, jint note, jint velocity)
1559 {
1560 handle_t *handle = NULL;
1561 memcpy(&handle, &ptr, sizeof(handle));
1562@@ -154,7 +154,7 @@
1563 }
1564 }
1565
1566-JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_programChange(JNIEnv* env, jobject ojb, jlong ptr, jint channel, jint program)
1567+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_programChange(JNIEnv* env, jobject obj, jlong ptr, jint channel, jint program)
1568 {
1569 handle_t *handle = NULL;
1570 memcpy(&handle, &ptr, sizeof(handle));
1571@@ -171,7 +171,7 @@
1572 }
1573 }
1574
1575-JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_controlChange(JNIEnv* env, jobject ojb, jlong ptr, jint channel, jint control, jint value)
1576+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_controlChange(JNIEnv* env, jobject obj, jlong ptr, jint channel, jint control, jint value)
1577 {
1578 handle_t *handle = NULL;
1579 memcpy(&handle, &ptr, sizeof(handle));
1580@@ -188,7 +188,7 @@
1581 }
1582 }
1583
1584-JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_pitchBend(JNIEnv* env, jobject ojb, jlong ptr, jint channel, jint value)
1585+JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player_impl_midiport_alsa_MidiSystem_pitchBend(JNIEnv* env, jobject obj, jlong ptr, jint channel, jint value)
1586 {
1587 handle_t *handle = NULL;
1588 memcpy(&handle, &ptr, sizeof(handle));
1589
1590=== modified file 'TuxGuitar-alsa/src/org/herac/tuxguitar/player/impl/midiport/alsa/MidiOutputPortImpl.java'
1591--- TuxGuitar-alsa/src/org/herac/tuxguitar/player/impl/midiport/alsa/MidiOutputPortImpl.java 2009-04-25 19:49:27 +0000
1592+++ TuxGuitar-alsa/src/org/herac/tuxguitar/player/impl/midiport/alsa/MidiOutputPortImpl.java 2010-05-21 18:17:28 +0000
1593@@ -3,16 +3,17 @@
1594 import org.herac.tuxguitar.player.base.MidiOutputPort;
1595 import org.herac.tuxguitar.player.base.MidiReceiver;
1596
1597-public class MidiOutputPortImpl extends MidiOutputPort{
1598-
1599- private final int port;
1600- private final int client;
1601- private final MidiReceiverImpl receiver;
1602-
1603- public MidiOutputPortImpl(MidiSystem midiSystem,String name,int client,int port){
1604- super(MidiOutputPortImpl.getUniqueKey(client, port),MidiOutputPortImpl.getUniqueName(name, client, port));
1605+public class MidiOutputPortImpl implements MidiOutputPort{
1606+
1607+ private int port;
1608+ private int client;
1609+ private String clientName;
1610+ private MidiReceiverImpl receiver;
1611+
1612+ public MidiOutputPortImpl(MidiSystem midiSystem,String clientName,int client,int port){
1613+ this.port = port;
1614 this.client = client;
1615- this.port = port;
1616+ this.clientName = clientName;
1617 this.receiver = new MidiReceiverImpl(this,midiSystem);
1618 }
1619
1620@@ -43,11 +44,11 @@
1621 return this.client;
1622 }
1623
1624- public static String getUniqueKey(int client,int port){
1625- return ("tuxguitar-alsa_" + client + "-" + port);
1626+ public String getKey(){
1627+ return ("tuxguitar-alsa_" + this.client + "-" + this.port);
1628 }
1629
1630- public static String getUniqueName(String name,int client,int port){
1631- return (name +" [" + client + ":" + port + "]");
1632+ public String getName(){
1633+ return (this.clientName +" [" + this.client + ":" + this.port + "]");
1634 }
1635 }
1636\ No newline at end of file
1637
1638=== modified file 'TuxGuitar-ascii/GNUmakefile'
1639--- TuxGuitar-ascii/GNUmakefile 2008-06-19 00:30:30 +0000
1640+++ TuxGuitar-ascii/GNUmakefile 2010-05-21 18:17:28 +0000
1641@@ -5,7 +5,7 @@
1642 #licence: LGPL
1643 #------------------------------------------------------------------------------
1644 PACKAGE?=tuxguitar-ascii
1645-LIBRARY?=lib${PACKAGE}.so
1646+LIBRARY?=lib$(PACKAGE).so
1647 LIBRARY_PROVIDER?=org.herac.tuxguitar.io.ascii.ASCIIPluginExporter
1648
1649 PREFIX?=/usr
1650@@ -15,22 +15,22 @@
1651
1652 # tuxguitar paths
1653 TG_SERVICE_CLASS?=org.herac.tuxguitar.gui.system.plugins.TGPlugin
1654-TG_PREFIX?=${PREFIX}
1655-TG_SOURCE_PATH?=${TG_PREFIX}/src
1656-TG_LIBRARY_PATH?=${TG_PREFIX}/lib
1657-TG_NATIVE_PLUGINS_PATH?=${TG_PREFIX}/share/tuxguitar/plugins
1658+TG_PREFIX?=$(PREFIX)
1659+TG_SOURCE_PATH?=$(TG_PREFIX)/src
1660+TG_LIBRARY_PATH?=$(TG_PREFIX)/lib
1661+TG_NATIVE_PLUGINS_PATH?=$(TG_PREFIX)/share/tuxguitar/plugins
1662
1663 # install paths
1664-INSTALL_LIBRARY_DIR?=${TG_NATIVE_PLUGINS_PATH}
1665-INSTALL_SERVICE_DIR?=${TG_NATIVE_PLUGINS_PATH}/${PACKAGE}/META-INF/services
1666+INSTALL_LIBRARY_DIR?=$(TG_NATIVE_PLUGINS_PATH)
1667+INSTALL_SERVICE_DIR?=$(TG_NATIVE_PLUGINS_PATH)/$(PACKAGE)/META-INF/services
1668
1669 # build paths
1670 SOURCE_PATH?=./src/
1671-SOURCES?=$(shell find ${SOURCE_PATH} -name "*.java")
1672-OBJECTS?=${SOURCES:%.java=%.o}
1673+SOURCES?=$(shell find $(SOURCE_PATH) -name "*.java")
1674+OBJECTS?=$(PACKAGE).o
1675
1676 GCJ?=gcj
1677-GCJFLAGS+=-fjni -I${SOURCE_PATH} -I${TG_SOURCE_PATH} -I${SWT_PATH}
1678+GCJFLAGS+=-fjni -I$(SOURCE_PATH) -I$(TG_SOURCE_PATH) -I$(SWT_PATH)
1679
1680 default: all
1681
1682@@ -38,35 +38,35 @@
1683
1684 objects: tmp.classes.tmp
1685
1686-tmp.classes.tmp: ${OBJECTS}
1687+tmp.classes.tmp: $(OBJECTS)
1688 @touch $@
1689
1690-library: ${LIBRARY}
1691+library: $(LIBRARY)
1692
1693 install:
1694- -install -d $(DESTDIR)${PREFIX}/
1695- -install -d $(DESTDIR)${INSTALL_LIBRARY_DIR}/
1696- -install -d $(DESTDIR)${INSTALL_SERVICE_DIR}/
1697- -install ${LIBRARY} $(DESTDIR)${INSTALL_LIBRARY_DIR}/${LIBRARY}
1698- -install ${TG_SERVICE_CLASS} $(DESTDIR)${INSTALL_SERVICE_DIR}/${TG_SERVICE_CLASS}
1699+ -install -d $(DESTDIR)$(PREFIX)/
1700+ -install -d $(DESTDIR)$(INSTALL_LIBRARY_DIR)/
1701+ -install -d $(DESTDIR)$(INSTALL_SERVICE_DIR)/
1702+ -install $(LIBRARY) $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
1703+ -install $(TG_SERVICE_CLASS) $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
1704
1705 uninstall:
1706- -rm $(DESTDIR)${INSTALL_LIBRARY_DIR}/${LIBRARY}
1707- -rm $(DESTDIR)${INSTALL_SERVICE_DIR}/${TG_SERVICE_CLASS}
1708+ -rm $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
1709+ -rm $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
1710
1711 clean:
1712 -@find . -name "*.o" -exec rm -f {} \; > /dev/null 2>&1
1713 -@find . -name "*.so" -exec rm -f {} \; > /dev/null 2>&1
1714 -@find . -name "*.tmp" -exec rm -f {} \; > /dev/null 2>&1
1715- -@rm ${TG_SERVICE_CLASS}
1716-
1717-%.o: %.java
1718- ${GCJ} ${GCJFLAGS} -c -o $@ $<
1719-
1720-%.so: ${OBJECTS}
1721- ${GCJ} -shared -o $@ -ltuxguitar -L${TG_LIBRARY_PATH} $^
1722+ -@rm $(TG_SERVICE_CLASS)
1723+
1724+$(PACKAGE).o: $(SOURCES)
1725+ $(GCJ) $(GCJFLAGS) -c -o $(@F) $^
1726+
1727+$(LIBRARY): $(OBJECTS)
1728+ ${GCJ} -shared -o $@ -ltuxguitar -L$(TG_LIBRARY_PATH) $(^F)
1729
1730 meta-inf:
1731- echo ${LIBRARY_PROVIDER} > ${TG_SERVICE_CLASS}
1732+ echo $(LIBRARY_PROVIDER) > $(TG_SERVICE_CLASS)
1733
1734 #eof "$Id: GNUmakefile,v 1.4 2008/02/26 15:25:31 akdmia Exp $"
1735\ No newline at end of file
1736
1737=== modified file 'TuxGuitar-ascii/build.properties'
1738--- TuxGuitar-ascii/build.properties 2008-06-19 00:30:30 +0000
1739+++ TuxGuitar-ascii/build.properties 2010-05-21 18:17:28 +0000
1740@@ -4,4 +4,4 @@
1741 ant.build.javac.source=1.4
1742 ant.build.javac.target=1.4
1743
1744-path.tuxguitar=../TuxGuitar/build
1745\ No newline at end of file
1746+path.tuxguitar=../TuxGuitar/build
1747
1748=== modified file 'TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIIPluginExporter.java'
1749--- TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIIPluginExporter.java 2008-06-19 00:30:30 +0000
1750+++ TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIIPluginExporter.java 2010-05-21 18:17:28 +0000
1751@@ -1,11 +1,11 @@
1752 package org.herac.tuxguitar.io.ascii;
1753
1754 import org.herac.tuxguitar.gui.system.plugins.base.TGExporterPlugin;
1755-import org.herac.tuxguitar.io.base.TGSongExporter;
1756+import org.herac.tuxguitar.io.base.TGRawExporter;
1757
1758 public class ASCIIPluginExporter extends TGExporterPlugin{
1759
1760- protected TGSongExporter getExporter() {
1761+ protected TGRawExporter getExporter() {
1762 return new ASCIISongExporter();
1763 }
1764
1765
1766=== modified file 'TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIISongExporter.java'
1767--- TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIISongExporter.java 2008-06-19 00:30:30 +0000
1768+++ TuxGuitar-ascii/src/org/herac/tuxguitar/io/ascii/ASCIISongExporter.java 2010-05-21 18:17:28 +0000
1769@@ -3,10 +3,13 @@
1770 import java.io.OutputStream;
1771
1772 import org.herac.tuxguitar.io.base.TGFileFormat;
1773-import org.herac.tuxguitar.io.base.TGSongExporter;
1774+import org.herac.tuxguitar.io.base.TGLocalFileExporter;
1775+import org.herac.tuxguitar.song.factory.TGFactory;
1776 import org.herac.tuxguitar.song.models.TGSong;
1777
1778-public class ASCIISongExporter implements TGSongExporter{
1779+public class ASCIISongExporter implements TGLocalFileExporter{
1780+
1781+ private OutputStream stream;
1782
1783 public String getExportName() {
1784 return "ASCII";
1785@@ -20,8 +23,14 @@
1786 return true;
1787 }
1788
1789- public void exportSong(OutputStream stream, TGSong song) {
1790- new ASCIITabOutputStream(stream).writeSong(song);
1791+ public void init(TGFactory factory,OutputStream stream){
1792+ this.stream = stream;
1793+ }
1794+
1795+ public void exportSong(TGSong song) {
1796+ if( this.stream != null ){
1797+ new ASCIITabOutputStream(this.stream).writeSong(song);
1798+ }
1799 }
1800
1801 }
1802\ No newline at end of file
1803
1804=== added file 'TuxGuitar-browser-ftp/GNUmakefile'
1805--- TuxGuitar-browser-ftp/GNUmakefile 1970-01-01 00:00:00 +0000
1806+++ TuxGuitar-browser-ftp/GNUmakefile 2010-05-21 18:17:28 +0000
1807@@ -0,0 +1,72 @@
1808+#! /usr/bin/make -f
1809+# -*- makefile -*-
1810+#ident "$Id: GNUmakefile,v 1.4 2008/02/26 15:25:31 akdmia Exp $"
1811+#@author: created by www.philippe.coval.online.fr -- revision: $Author: akdmia $
1812+#licence: LGPL
1813+#------------------------------------------------------------------------------
1814+PACKAGE?=tuxguitar-browser-ftp
1815+LIBRARY?=lib$(PACKAGE).so
1816+LIBRARY_PROVIDER?=org.herac.tuxguitar.gui.tools.browser.ftp.TGBrowserPluginImpl
1817+
1818+PREFIX?=/usr
1819+
1820+# dependencies
1821+SWT_PATH?=/usr/share/java/swt.jar
1822+
1823+# tuxguitar paths
1824+TG_SERVICE_CLASS?=org.herac.tuxguitar.gui.system.plugins.TGPlugin
1825+TG_PREFIX?=$(PREFIX)
1826+TG_SOURCE_PATH?=$(TG_PREFIX)/src
1827+TG_LIBRARY_PATH?=$(TG_PREFIX)/lib
1828+TG_NATIVE_PLUGINS_PATH?=$(TG_PREFIX)/share/tuxguitar/plugins
1829+
1830+# install paths
1831+INSTALL_LIBRARY_DIR?=$(TG_NATIVE_PLUGINS_PATH)
1832+INSTALL_SERVICE_DIR?=$(TG_NATIVE_PLUGINS_PATH)/$(PACKAGE)/META-INF/services
1833+
1834+# build paths
1835+SOURCE_PATH?=./src/
1836+SOURCES?=$(shell find $(SOURCE_PATH) -name "*.java")
1837+OBJECTS?=$(PACKAGE).o
1838+
1839+GCJ?=gcj
1840+GCJFLAGS+=-fjni -I$(SOURCE_PATH) -I$(TG_SOURCE_PATH) -I$(SWT_PATH)
1841+
1842+default: all
1843+
1844+all: objects library meta-inf
1845+
1846+objects: tmp.classes.tmp
1847+
1848+tmp.classes.tmp: $(OBJECTS)
1849+ @touch $@
1850+
1851+library: $(LIBRARY)
1852+
1853+install:
1854+ -install -d $(DESTDIR)$(PREFIX)/
1855+ -install -d $(DESTDIR)$(INSTALL_LIBRARY_DIR)/
1856+ -install -d $(DESTDIR)$(INSTALL_SERVICE_DIR)/
1857+ -install $(LIBRARY) $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
1858+ -install $(TG_SERVICE_CLASS) $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
1859+
1860+uninstall:
1861+ -rm $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
1862+ -rm $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
1863+
1864+clean:
1865+ -@find . -name "*.o" -exec rm -f {} \; > /dev/null 2>&1
1866+ -@find . -name "*.so" -exec rm -f {} \; > /dev/null 2>&1
1867+ -@find . -name "*.tmp" -exec rm -f {} \; > /dev/null 2>&1
1868+ -@rm $(TG_SERVICE_CLASS)
1869+
1870+$(PACKAGE).o: $(SOURCES)
1871+ $(GCJ) $(GCJFLAGS) -c -o $(@F) $^
1872+
1873+$(LIBRARY): $(OBJECTS)
1874+ ${GCJ} -shared -o $@ -ltuxguitar -L$(TG_LIBRARY_PATH) $(^F)
1875+
1876+meta-inf:
1877+ echo $(LIBRARY_PROVIDER) > $(TG_SERVICE_CLASS)
1878+
1879+#eof "$Id: GNUmakefile,v 1.4 2008/02/26 15:25:31 akdmia Exp $"
1880
1881=== modified file 'TuxGuitar-browser-ftp/build.properties'
1882--- TuxGuitar-browser-ftp/build.properties 2008-06-19 00:30:30 +0000
1883+++ TuxGuitar-browser-ftp/build.properties 2010-05-21 18:17:28 +0000
1884@@ -5,4 +5,4 @@
1885 ant.build.javac.target=1.4
1886
1887 path.tuxguitar=../TuxGuitar/build
1888-path.swt=../TuxGuitar/lib/swt.jar
1889\ No newline at end of file
1890+path.swt=../TuxGuitar/lib/swt.jar
1891
1892=== added file 'TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserElementComparator.java'
1893--- TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserElementComparator.java 1970-01-01 00:00:00 +0000
1894+++ TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserElementComparator.java 2010-05-21 18:17:28 +0000
1895@@ -0,0 +1,36 @@
1896+package org.herac.tuxguitar.gui.tools.browser.ftp;
1897+
1898+import java.util.Comparator;
1899+
1900+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserElement;
1901+
1902+public class TGBrowserElementComparator implements Comparator {
1903+
1904+ private static final int RESULT_LESS = -1;
1905+
1906+ private static final int RESULT_EQUAL = 0;
1907+
1908+ private static final int RESULT_GREATER = 1;
1909+
1910+ private static final int DIRECTION = 1;
1911+
1912+ private static final int DIRECTION_FOLDER = 1;
1913+
1914+ public int compare(Object o1, Object o2) {
1915+ if(o1 instanceof TGBrowserElement && o2 instanceof TGBrowserElement){
1916+ TGBrowserElement element1 = (TGBrowserElement)o1;
1917+ TGBrowserElement element2 = (TGBrowserElement)o2;
1918+
1919+ if(element1.isFolder() && !element2.isFolder()){
1920+ return (DIRECTION_FOLDER * RESULT_LESS);
1921+ }
1922+ if(element2.isFolder() && !element1.isFolder()){
1923+ return (DIRECTION_FOLDER * RESULT_GREATER);
1924+ }
1925+
1926+ return (DIRECTION * (element1.getName().compareTo(element2.getName())));
1927+ }
1928+ return RESULT_EQUAL;
1929+ }
1930+
1931+}
1932
1933=== modified file 'TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserImpl.java'
1934--- TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserImpl.java 2009-04-25 19:49:27 +0000
1935+++ TuxGuitar-browser-ftp/src/org/herac/tuxguitar/gui/tools/browser/ftp/TGBrowserImpl.java 2010-05-21 18:17:28 +0000
1936@@ -5,6 +5,7 @@
1937 import java.net.Authenticator;
1938 import java.net.PasswordAuthentication;
1939 import java.util.ArrayList;
1940+import java.util.Collections;
1941 import java.util.List;
1942 import java.util.Properties;
1943
1944@@ -115,6 +116,9 @@
1945 }
1946 }
1947 }
1948+ if( !elements.isEmpty() ){
1949+ Collections.sort(elements,new TGBrowserElementComparator());
1950+ }
1951 } catch (Throwable throwable) {
1952 throw new TGBrowserException(throwable);
1953 }
1954
1955=== modified file 'TuxGuitar-carbon-integration/build.properties'
1956--- TuxGuitar-carbon-integration/build.properties 2009-04-25 19:49:27 +0000
1957+++ TuxGuitar-carbon-integration/build.properties 2010-05-21 18:17:28 +0000
1958@@ -5,4 +5,4 @@
1959 ant.build.javac.target=1.4
1960
1961 path.tuxguitar=../TuxGuitar/build
1962-path.swt=../TuxGuitar/lib/swt.jar
1963\ No newline at end of file
1964+path.swt=../TuxGuitar/lib/swt.jar
1965
1966=== added directory 'TuxGuitar-cocoa-integration'
1967=== added file 'TuxGuitar-cocoa-integration/build.properties'
1968--- TuxGuitar-cocoa-integration/build.properties 1970-01-01 00:00:00 +0000
1969+++ TuxGuitar-cocoa-integration/build.properties 2010-05-21 18:17:28 +0000
1970@@ -0,0 +1,8 @@
1971+### ANT Flags
1972+#
1973+# build.compiler=gcj
1974+ant.build.javac.source=1.4
1975+ant.build.javac.target=1.4
1976+
1977+path.tuxguitar=../TuxGuitar/build
1978+path.swt=../TuxGuitar/lib/swt.jar
1979
1980=== added file 'TuxGuitar-cocoa-integration/build.xml'
1981--- TuxGuitar-cocoa-integration/build.xml 1970-01-01 00:00:00 +0000
1982+++ TuxGuitar-cocoa-integration/build.xml 2010-05-21 18:17:28 +0000
1983@@ -0,0 +1,53 @@
1984+<?xml version="1.0" encoding="iso-8859-1"?>
1985+
1986+<project name="TuxGuitar-cocoa-integration" basedir="." default="all">
1987+ <description>
1988+ TuxGuitar-cocoa-integration
1989+ </description>
1990+
1991+ <property file="build.properties" />
1992+ <property name="build.src.path" value="src" />
1993+ <property name="build.path" value="build" />
1994+ <property name="build.jar" value="tuxguitar-cocoa-integration.jar" />
1995+
1996+ <property name="service.class" value="org.herac.tuxguitar.gui.system.plugins.TGPlugin" />
1997+ <property name="service.provider" value="org.herac.tuxguitar.cocoa.TGCocoaIntegrationPlugin" />
1998+
1999+ <path id="class.path">
2000+ <pathelement location="${path.tuxguitar}"/>
2001+ <pathelement location="${path.swt}"/>
2002+ </path >
2003+
2004+ <target name="init" depends="clean">
2005+ <mkdir dir="${build.path}" />
2006+ </target>
2007+
2008+ <target name="build" depends="init">
2009+ <echo>+-------------------------------------------------+</echo>
2010+ <echo>| B U I L D I N G L I B R A R Y |</echo>
2011+ <echo>+-------------------------------------------------+</echo>
2012+
2013+ <javac srcdir="${build.src.path}" destdir="${build.path}" debug="false" >
2014+ <classpath refid="class.path"/>
2015+ <include name="**/*.java"/>
2016+ </javac>
2017+
2018+ <mkdir dir="${build.path}/META-INF/services" />
2019+ <echo file="${build.path}/META-INF/services/${service.class}" append="false">${service.provider}</echo>
2020+
2021+ <echo>+-----------------------------------------------+</echo>
2022+ <echo>| P A C K A G I N G L I B R A R Y |</echo>
2023+ <echo>+-----------------------------------------------+</echo>
2024+
2025+ <jar destfile="${build.jar}" basedir="${build.path}" />
2026+ <delete quiet="true" dir="${build.path}" />
2027+ </target>
2028+
2029+ <target name="clean">
2030+ <delete quiet="true" dir="${build.path}" />
2031+ <delete quiet="true" file="${build.jar}" />
2032+ </target>
2033+
2034+ <target name="all" depends="build" />
2035+</project>
2036+<!-- eof "$Id: build.xml,v 1.6 2008/02/28 00:35:00 rzr Exp $" -->
2037
2038=== added directory 'TuxGuitar-cocoa-integration/src'
2039=== added directory 'TuxGuitar-cocoa-integration/src/org'
2040=== added directory 'TuxGuitar-cocoa-integration/src/org/herac'
2041=== added directory 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar'
2042=== added directory 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa'
2043=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoa.java'
2044--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoa.java 1970-01-01 00:00:00 +0000
2045+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoa.java 2010-05-21 18:17:28 +0000
2046@@ -0,0 +1,142 @@
2047+package org.herac.tuxguitar.cocoa;
2048+
2049+import java.lang.reflect.Method;
2050+
2051+import org.eclipse.swt.internal.C;
2052+import org.eclipse.swt.internal.Callback;
2053+import org.eclipse.swt.internal.cocoa.NSButton;
2054+import org.eclipse.swt.internal.cocoa.NSControl;
2055+import org.eclipse.swt.internal.cocoa.NSMenu;
2056+import org.eclipse.swt.internal.cocoa.NSMenuItem;
2057+import org.eclipse.swt.internal.cocoa.NSString;
2058+import org.eclipse.swt.internal.cocoa.NSWindow;
2059+import org.eclipse.swt.internal.cocoa.OS;
2060+import org.herac.tuxguitar.cocoa.toolbar.MacToolbarDelegate;
2061+
2062+public class TGCocoa {
2063+
2064+ public static final int noErr = OS.noErr;
2065+
2066+ public static final long sel_registerName(String selectorName){
2067+ try {
2068+ return longValue(invokeMethod(OS.class, "sel_registerName", new Object[] { selectorName }));
2069+ }catch (Throwable throwable){
2070+ throwable.printStackTrace();
2071+ }
2072+ return 0;
2073+ }
2074+
2075+ public static final long objc_lookUpClass(String classname) throws Throwable{
2076+ return longValue(invokeMethod(OS.class, "objc_lookUpClass", new Object[] { classname }));
2077+ }
2078+
2079+ public static final long objc_allocateClassPair(String name, long extraBytes) throws Throwable{
2080+ return longValue(invokeMethod(OS.class, "objc_allocateClassPair", new Object[] { OS.class.getField("class_NSObject").get(OS.class), name, osType(extraBytes) }));
2081+ }
2082+
2083+ public static final boolean class_addIvar(long cls, byte[] name, long size, byte alignment, byte[] types) throws Throwable{
2084+ return boolValue(invokeMethod(OS.class, "class_addIvar", new Object[] { osType(cls), name, osType(size), new Byte(alignment), types }));
2085+ }
2086+
2087+ public static final long object_setInstanceVariable(Object idValue, byte[] name, long value) throws Throwable{
2088+ return longValue(invokeMethod(OS.class, "object_setInstanceVariable", new Object[] { idValue , name, osType(value) }));
2089+ }
2090+
2091+ public static final boolean class_addMethod(long cls, long name, long imp, String types) throws Throwable{
2092+ return boolValue(invokeMethod(OS.class,"class_addMethod", new Object[] { osType(cls), osType(name), osType(imp), types }));
2093+ }
2094+
2095+ public static final void objc_registerClassPair(long cls) throws Throwable{
2096+ invokeMethod(OS.class, "objc_registerClassPair", new Object[] { osType(cls) });
2097+ }
2098+
2099+ public static final void setControlAction(NSControl control, long aSelector) throws Throwable{
2100+ invokeMethod(NSControl.class, control, "setAction", new Object[] { osType(aSelector) });
2101+ }
2102+
2103+ public static final void setControlAction(NSMenuItem control, long aSelector) throws Throwable{
2104+ invokeMethod(NSMenuItem.class, control, "setAction", new Object[] { osType(aSelector) });
2105+ }
2106+
2107+ public static final NSMenuItem getMenuItemAtIndex(NSMenu menu, long index) throws Throwable{
2108+ return (NSMenuItem)invokeMethod(NSMenu.class, menu, "itemAtIndex", new Object[] { osType(index) });
2109+ }
2110+
2111+ public static final NSButton getStandardWindowButton(NSWindow nsWindow, long index) throws Throwable{
2112+ return (NSButton)invokeMethod(NSWindow.class, nsWindow, "standardWindowButton", new Object[] { osType(index) });
2113+ }
2114+
2115+ public static final String getNSStringValue( long pointer ) throws Throwable {
2116+ NSString nsString = new NSString();
2117+ NSString.class.getField("id").set(nsString, osType(pointer) );
2118+ return nsString.getString();
2119+ }
2120+
2121+ public static final Callback newCallback(Object object, String method64, String method32, int argCount) throws Throwable {
2122+ return new Callback( object, ( C.PTR_SIZEOF == 8 ? method64 : method32 ) , argCount );
2123+ }
2124+
2125+ public static final long getCallbackAddress( Callback callback ) throws Throwable {
2126+ return longValue(invokeMethod(Callback.class, callback , "getAddress", new Object[] {}));
2127+ }
2128+
2129+ public static final long getMenuNumberOfItems( NSMenu menu ) throws Throwable {
2130+ return longValue(invokeMethod(NSMenu.class, menu , "numberOfItems", new Object[] {}));
2131+ }
2132+
2133+ public static final long NewGlobalRef( Object object ) throws Throwable{
2134+ Method method = OS.class.getMethod("NewGlobalRef", new Class[] { Object.class });
2135+ return longValue( method.invoke(OS.class, new Object[] { object }) ) ;
2136+ }
2137+
2138+ public static final void DeleteGlobalRef( long ref ) throws Throwable{
2139+ invokeMethod(OS.class, "DeleteGlobalRef", new Object[] { osType(ref) } );
2140+ }
2141+
2142+ public static final MacToolbarDelegate newMacToolbarDelegate() throws Throwable{
2143+ return (MacToolbarDelegate)Class.forName( MacToolbarDelegate.class.getName() ).newInstance();
2144+ }
2145+
2146+ private static Object invokeMethod(Class clazz, String methodName, Object[] args) throws Throwable {
2147+ return invokeMethod(clazz, null, methodName, args);
2148+ }
2149+
2150+ private static Object invokeMethod(Class clazz, Object target, String methodName, Object[] args) throws Throwable {
2151+ Class[] signature = new Class[args.length];
2152+ for (int i = 0; i < args.length; i++) {
2153+ Class thisClass = args[i].getClass();
2154+ if (thisClass == Integer.class){
2155+ signature[i] = int.class;
2156+ }else if (thisClass == Long.class){
2157+ signature[i] = long.class;
2158+ }else if (thisClass == Byte.class){
2159+ signature[i] = byte.class;
2160+ }else{
2161+ signature[i] = thisClass;
2162+ }
2163+ }
2164+ Method method = clazz.getMethod(methodName, signature);
2165+ return method.invoke(target, args);
2166+ }
2167+
2168+ private static Object osType( long value ) {
2169+ return ( C.PTR_SIZEOF == 8 ? ((Object)new Long(value)) : ((Object)new Integer((int)value)) );
2170+ }
2171+
2172+ private static long longValue(Object object) {
2173+ if (object instanceof Integer) {
2174+ return ((Integer) object).longValue();
2175+ }
2176+ if (object instanceof Long) {
2177+ return ((Long) object).longValue();
2178+ }
2179+ return 0;
2180+ }
2181+
2182+ private static boolean boolValue(Object object) {
2183+ if (object instanceof Boolean) {
2184+ return ((Boolean) object).booleanValue();
2185+ }
2186+ return false;
2187+ }
2188+}
2189
2190=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoaIntegrationPlugin.java'
2191--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoaIntegrationPlugin.java 1970-01-01 00:00:00 +0000
2192+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/TGCocoaIntegrationPlugin.java 2010-05-21 18:17:28 +0000
2193@@ -0,0 +1,44 @@
2194+package org.herac.tuxguitar.cocoa;
2195+
2196+import java.util.ArrayList;
2197+import java.util.List;
2198+
2199+import org.herac.tuxguitar.cocoa.menu.MacMenuPlugin;
2200+import org.herac.tuxguitar.cocoa.opendoc.OpenDocPlugin;
2201+import org.herac.tuxguitar.cocoa.toolbar.MacToolbarPlugin;
2202+import org.herac.tuxguitar.cocoa.modifiedmarker.ModifiedMarkerPlugin;
2203+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
2204+import org.herac.tuxguitar.gui.system.plugins.base.TGPluginList;
2205+
2206+public class TGCocoaIntegrationPlugin extends TGPluginList {
2207+
2208+ private List plugins;
2209+
2210+ protected List getPlugins() throws TGPluginException {
2211+ if( this.plugins == null ){
2212+ this.plugins = new ArrayList();
2213+
2214+ this.plugins.add(new OpenDocPlugin());
2215+ this.plugins.add(new MacMenuPlugin());
2216+ this.plugins.add(new MacToolbarPlugin());
2217+ this.plugins.add(new ModifiedMarkerPlugin());
2218+ }
2219+ return this.plugins;
2220+ }
2221+
2222+ public String getAuthor() {
2223+ return "Auria & Julian Casadesus";
2224+ }
2225+
2226+ public String getDescription() {
2227+ return "Cocoa Integration Plugin";
2228+ }
2229+
2230+ public String getName() {
2231+ return "Cocoa Integration Plugin";
2232+ }
2233+
2234+ public String getVersion() {
2235+ return "1.0";
2236+ }
2237+}
2238
2239=== added directory 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu'
2240=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenu.java'
2241--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenu.java 1970-01-01 00:00:00 +0000
2242+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenu.java 2010-05-21 18:17:28 +0000
2243@@ -0,0 +1,98 @@
2244+package org.herac.tuxguitar.cocoa.menu;
2245+
2246+import org.eclipse.swt.internal.Callback;
2247+import org.eclipse.swt.internal.cocoa.NSApplication;
2248+import org.eclipse.swt.internal.cocoa.NSMenu;
2249+import org.eclipse.swt.internal.cocoa.NSMenuItem;
2250+import org.herac.tuxguitar.cocoa.TGCocoa;
2251+import org.herac.tuxguitar.gui.TuxGuitar;
2252+import org.herac.tuxguitar.gui.actions.file.ExitAction;
2253+import org.herac.tuxguitar.gui.actions.help.ShowAboutAction;
2254+import org.herac.tuxguitar.gui.actions.settings.EditConfigAction;
2255+
2256+public class MacMenu {
2257+
2258+ private static final long kAboutMenuItem = 0;
2259+ private static final long kPreferencesMenuItem = 2;
2260+
2261+ private static long sel_preferencesMenuItemSelected_ = TGCocoa.sel_registerName("preferencesMenuItemSelected:");
2262+ private static long sel_aboutMenuItemSelected_ = TGCocoa.sel_registerName("aboutMenuItemSelected:");
2263+
2264+ private boolean enabled;
2265+
2266+ public MacMenu(){
2267+ super();
2268+ }
2269+
2270+ public void init() throws Throwable{
2271+ long cls = TGCocoa.objc_lookUpClass ("SWTApplicationDelegate");
2272+ if( cls != 0 ){
2273+ Callback callback = TGCocoa.newCallback( this , "callbackProc64", "callbackProc32", 3 );
2274+ long callbackProc = TGCocoa.getCallbackAddress( callback );
2275+ if( callbackProc != 0 ){
2276+ TGCocoa.class_addMethod(cls, sel_preferencesMenuItemSelected_, callbackProc , "@:@");
2277+ TGCocoa.class_addMethod(cls, sel_aboutMenuItemSelected_, callbackProc , "@:@");
2278+ }
2279+ }
2280+ NSApplication app = NSApplication.sharedApplication();
2281+ NSMenu mainMenu = app.mainMenu();
2282+ if( TGCocoa.getMenuNumberOfItems( mainMenu ) > 0 ){
2283+ NSMenuItem appMenuItem = TGCocoa.getMenuItemAtIndex( mainMenu , 0 );
2284+ NSMenu appMenu = appMenuItem.submenu();
2285+
2286+ long itemCount = TGCocoa.getMenuNumberOfItems( appMenu );
2287+ if( itemCount > kPreferencesMenuItem ) {
2288+ NSMenuItem menuItem = TGCocoa.getMenuItemAtIndex( appMenu , kPreferencesMenuItem );
2289+ menuItem.setEnabled( true );
2290+ TGCocoa.setControlAction(menuItem, sel_preferencesMenuItemSelected_);
2291+ }
2292+ if( itemCount > kAboutMenuItem ) {
2293+ NSMenuItem menuItem = TGCocoa.getMenuItemAtIndex( appMenu , kAboutMenuItem );
2294+ menuItem.setEnabled( true );
2295+ TGCocoa.setControlAction(menuItem, sel_aboutMenuItemSelected_);
2296+ }
2297+ }
2298+ }
2299+
2300+ public long callbackProc( long id, long sel, long arg0 ) {
2301+ if ( this.isEnabled() ){
2302+ if ( sel == sel_preferencesMenuItemSelected_ ) {
2303+ return handlePreferencesCommand();
2304+ }else if ( sel == sel_aboutMenuItemSelected_ ) {
2305+ return handleAboutCommand();
2306+ }
2307+ }
2308+ return TGCocoa.noErr;
2309+ }
2310+
2311+ public long callbackProc64( long id, long sel, long arg0 ) {
2312+ return this.callbackProc(id, sel, arg0);
2313+ }
2314+
2315+ public int callbackProc32( int id, int sel, int arg0 ) {
2316+ return (int)this.callbackProc( (long)id, (long)sel, (long)arg0);
2317+ }
2318+
2319+ public boolean isEnabled() {
2320+ return this.enabled;
2321+ }
2322+
2323+ public void setEnabled(boolean enabled) {
2324+ this.enabled = enabled;
2325+ }
2326+
2327+ public long handleQuitCommand(){
2328+ TuxGuitar.instance().getAction(ExitAction.NAME).process(null);
2329+ return TGCocoa.noErr;
2330+ }
2331+
2332+ public long handleAboutCommand(){
2333+ TuxGuitar.instance().getAction(ShowAboutAction.NAME).process(null);
2334+ return TGCocoa.noErr;
2335+ }
2336+
2337+ public long handlePreferencesCommand(){
2338+ TuxGuitar.instance().getAction(EditConfigAction.NAME).process(null);
2339+ return TGCocoa.noErr;
2340+ }
2341+}
2342
2343=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenuPlugin.java'
2344--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenuPlugin.java 1970-01-01 00:00:00 +0000
2345+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/menu/MacMenuPlugin.java 2010-05-21 18:17:28 +0000
2346@@ -0,0 +1,31 @@
2347+package org.herac.tuxguitar.cocoa.menu;
2348+
2349+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
2350+import org.herac.tuxguitar.gui.system.plugins.base.TGPluginAdapter;
2351+
2352+public class MacMenuPlugin extends TGPluginAdapter {
2353+
2354+ private MacMenu macMenu;
2355+
2356+ public void init() throws TGPluginException {
2357+ // Nothing todo
2358+ }
2359+
2360+ public void close() throws TGPluginException {
2361+ // Nothing todo
2362+ }
2363+
2364+ public void setEnabled(boolean enabled) throws TGPluginException {
2365+ try {
2366+ if( this.macMenu != null ){
2367+ this.macMenu.setEnabled(enabled);
2368+ }else if(enabled){
2369+ this.macMenu = new MacMenu();
2370+ this.macMenu.setEnabled(true);
2371+ this.macMenu.init();
2372+ }
2373+ } catch( Throwable throwable ){
2374+ throw new TGPluginException( throwable );
2375+ }
2376+ }
2377+}
2378
2379=== added directory 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker'
2380=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarker.java'
2381--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarker.java 1970-01-01 00:00:00 +0000
2382+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarker.java 2010-05-21 18:17:28 +0000
2383@@ -0,0 +1,44 @@
2384+package org.herac.tuxguitar.cocoa.modifiedmarker;
2385+
2386+import org.eclipse.swt.internal.cocoa.NSWindow;
2387+import org.eclipse.swt.widgets.Shell;
2388+import org.herac.tuxguitar.gui.TuxGuitar;
2389+import org.herac.tuxguitar.gui.editors.TGUpdateListener;
2390+
2391+public class ModifiedMarker implements TGUpdateListener {
2392+
2393+ private boolean enabled;
2394+
2395+ public ModifiedMarker(){
2396+ super();
2397+ }
2398+
2399+ /** From 'TGUpdateListener' */
2400+ public void doUpdate( int type ){
2401+ if (!enabled) return;
2402+
2403+ final boolean isEdited = TuxGuitar.instance().getFileHistory().isUnsavedFile();
2404+ setFrameState( isEdited );
2405+ }
2406+
2407+ public void init() throws Throwable{
2408+ TuxGuitar.instance().getEditorManager().addUpdateListener(this);
2409+ }
2410+
2411+ public boolean isEnabled() {
2412+ return this.enabled;
2413+ }
2414+
2415+ public void setEnabled(boolean enabled) {
2416+ this.enabled = enabled;
2417+
2418+ if (!enabled) setFrameState(false);
2419+ }
2420+
2421+ private void setFrameState(boolean modified) {
2422+ Shell shell = TuxGuitar.instance().getShell();
2423+ NSWindow nsWindow = shell.view.window();
2424+ nsWindow.setDocumentEdited(modified);
2425+ }
2426+
2427+}
2428
2429=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarkerPlugin.java'
2430--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarkerPlugin.java 1970-01-01 00:00:00 +0000
2431+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/modifiedmarker/ModifiedMarkerPlugin.java 2010-05-21 18:17:28 +0000
2432@@ -0,0 +1,31 @@
2433+package org.herac.tuxguitar.cocoa.modifiedmarker;
2434+
2435+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
2436+import org.herac.tuxguitar.gui.system.plugins.base.TGPluginAdapter;
2437+
2438+public class ModifiedMarkerPlugin extends TGPluginAdapter {
2439+
2440+ private ModifiedMarker modifiedMarker;
2441+
2442+ public void init() throws TGPluginException {
2443+ // Nothing todo
2444+ }
2445+
2446+ public void close() throws TGPluginException {
2447+ // Nothing todo
2448+ }
2449+
2450+ public void setEnabled(boolean enabled) throws TGPluginException {
2451+ try {
2452+ if( this.modifiedMarker != null ){
2453+ this.modifiedMarker.setEnabled(enabled);
2454+ }else if(enabled){
2455+ this.modifiedMarker = new ModifiedMarker();
2456+ this.modifiedMarker.setEnabled(true);
2457+ this.modifiedMarker.init();
2458+ }
2459+ } catch( Throwable throwable ){
2460+ throw new TGPluginException( throwable );
2461+ }
2462+ }
2463+}
2464
2465=== added directory 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc'
2466=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocAction.java'
2467--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocAction.java 1970-01-01 00:00:00 +0000
2468+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocAction.java 2010-05-21 18:17:28 +0000
2469@@ -0,0 +1,69 @@
2470+package org.herac.tuxguitar.cocoa.opendoc;
2471+
2472+import org.eclipse.swt.SWT;
2473+import org.herac.tuxguitar.gui.TuxGuitar;
2474+import org.herac.tuxguitar.gui.actions.ActionLock;
2475+import org.herac.tuxguitar.gui.actions.file.FileActionUtils;
2476+import org.herac.tuxguitar.gui.helper.SyncThread;
2477+import org.herac.tuxguitar.gui.util.ConfirmDialog;
2478+
2479+public class OpenDocAction {
2480+
2481+ public static void saveAndOpen(final String file){
2482+ ActionLock.lock();
2483+
2484+ TuxGuitar.instance().getPlayer().reset();
2485+
2486+ if(TuxGuitar.instance().getFileHistory().isUnsavedFile()){
2487+ ConfirmDialog confirm = new ConfirmDialog(TuxGuitar.getProperty("file.save-changes-question"));
2488+ confirm.setDefaultStatus( ConfirmDialog.STATUS_CANCEL );
2489+ int status = confirm.confirm(ConfirmDialog.BUTTON_YES | ConfirmDialog.BUTTON_NO | ConfirmDialog.BUTTON_CANCEL, ConfirmDialog.BUTTON_YES);
2490+ if(status == ConfirmDialog.STATUS_CANCEL){
2491+ ActionLock.unlock();
2492+ return;
2493+ }
2494+ if(status == ConfirmDialog.STATUS_YES){
2495+ final String fileName = FileActionUtils.getFileName();
2496+ if(fileName == null){
2497+ ActionLock.unlock();
2498+ return;
2499+ }
2500+ TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
2501+ new Thread(new Runnable() {
2502+ public void run() {
2503+ if(!TuxGuitar.isDisposed()){
2504+ FileActionUtils.save(fileName);
2505+ new SyncThread(new Runnable() {
2506+ public void run() {
2507+ if(!TuxGuitar.isDisposed()){
2508+ TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
2509+ openFile( file );
2510+ }
2511+ }
2512+ }).start();
2513+ }
2514+ }
2515+ }).start();
2516+ return;
2517+ }
2518+ }
2519+ openFile(file );
2520+ }
2521+
2522+ protected static void openFile(final String url){
2523+ if(url == null){
2524+ ActionLock.unlock();
2525+ return;
2526+ }
2527+ TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
2528+ new Thread(new Runnable() {
2529+ public void run() {
2530+ if(!TuxGuitar.isDisposed()){
2531+ FileActionUtils.open(url);
2532+ TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
2533+ ActionLock.unlock();
2534+ }
2535+ }
2536+ }).start();
2537+ }
2538+}
2539
2540=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocListener.java'
2541--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocListener.java 1970-01-01 00:00:00 +0000
2542+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocListener.java 2010-05-21 18:17:28 +0000
2543@@ -0,0 +1,59 @@
2544+package org.herac.tuxguitar.cocoa.opendoc;
2545+
2546+import org.eclipse.swt.internal.Callback;
2547+import org.herac.tuxguitar.cocoa.TGCocoa;
2548+
2549+public class OpenDocListener {
2550+
2551+ public static final long sel_application_openFile_ = TGCocoa.sel_registerName("application:openFile:");
2552+
2553+ private boolean enabled;
2554+
2555+ public OpenDocListener(){
2556+ this.enabled = false;
2557+ }
2558+
2559+ public void init() throws Throwable{
2560+ long cls = TGCocoa.objc_lookUpClass ("SWTApplicationDelegate");
2561+ if( cls != 0 ){
2562+ Callback callback = TGCocoa.newCallback( this , "callbackProc64" , "callbackProc32", 4 );
2563+
2564+ long callbackProc = TGCocoa.getCallbackAddress( callback );
2565+ if( callbackProc != 0 ){
2566+ TGCocoa.class_addMethod(cls, sel_application_openFile_, callbackProc , "B:@@");
2567+ }
2568+ }
2569+ }
2570+
2571+ public long callbackProc(long id, long sel,long arg0, long arg1) {
2572+ if( this.isEnabled() ){
2573+ if (sel == sel_application_openFile_) {
2574+ try {
2575+ String filename = TGCocoa.getNSStringValue(arg1);
2576+ if( filename.length() > 0 ){
2577+ OpenDocAction.saveAndOpen( filename );
2578+ }
2579+ }catch (Throwable throwable){
2580+ throwable.printStackTrace();
2581+ }
2582+ }
2583+ }
2584+ return TGCocoa.noErr;
2585+ }
2586+
2587+ public long callbackProc64(long id, long sel,long arg0, long arg1) {
2588+ return this.callbackProc(id, sel, arg0, arg1);
2589+ }
2590+
2591+ public int callbackProc32(int id, int sel,int arg0, int arg1) {
2592+ return (int)this.callbackProc( (long)id, (long)sel, (long)arg0, (long)arg1);
2593+ }
2594+
2595+ public boolean isEnabled() {
2596+ return this.enabled;
2597+ }
2598+
2599+ public void setEnabled(boolean enabled) {
2600+ this.enabled = enabled;
2601+ }
2602+}
2603
2604=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocPlugin.java'
2605--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocPlugin.java 1970-01-01 00:00:00 +0000
2606+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/opendoc/OpenDocPlugin.java 2010-05-21 18:17:28 +0000
2607@@ -0,0 +1,31 @@
2608+package org.herac.tuxguitar.cocoa.opendoc;
2609+
2610+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
2611+import org.herac.tuxguitar.gui.system.plugins.base.TGPluginAdapter;
2612+
2613+public class OpenDocPlugin extends TGPluginAdapter {
2614+
2615+ private OpenDocListener openDocListener;
2616+
2617+ public void init() throws TGPluginException {
2618+ // Nothing todo
2619+ }
2620+
2621+ public void close() throws TGPluginException {
2622+ // Nothing todo
2623+ }
2624+
2625+ public void setEnabled(boolean enabled) throws TGPluginException {
2626+ try {
2627+ if( this.openDocListener != null ){
2628+ this.openDocListener.setEnabled(enabled);
2629+ }else if(enabled){
2630+ this.openDocListener = new OpenDocListener();
2631+ this.openDocListener.setEnabled(true);
2632+ this.openDocListener.init();
2633+ }
2634+ } catch( Throwable throwable ){
2635+ throw new TGPluginException( throwable );
2636+ }
2637+ }
2638+}
2639
2640=== added directory 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar'
2641=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbar.java'
2642--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbar.java 1970-01-01 00:00:00 +0000
2643+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbar.java 2010-05-21 18:17:28 +0000
2644@@ -0,0 +1,103 @@
2645+package org.herac.tuxguitar.cocoa.toolbar;
2646+
2647+import org.eclipse.swt.internal.C;
2648+import org.eclipse.swt.internal.Callback;
2649+import org.eclipse.swt.internal.cocoa.NSButton;
2650+import org.eclipse.swt.internal.cocoa.NSString;
2651+import org.eclipse.swt.internal.cocoa.NSToolbar;
2652+import org.eclipse.swt.internal.cocoa.NSWindow;
2653+import org.eclipse.swt.widgets.Shell;
2654+import org.herac.tuxguitar.cocoa.TGCocoa;
2655+
2656+public class MacToolbar {
2657+
2658+ private static final byte[] SWT_OBJECT = {'S', 'W', 'T', '_', 'O', 'B', 'J', 'E', 'C', 'T', '\0'};
2659+
2660+ private static final long NSWindowToolbarButton = 3;
2661+
2662+ private static final long sel_toolbarButtonClicked_ = TGCocoa.sel_registerName("toolbarButtonClicked:");
2663+
2664+ private boolean enabled;
2665+
2666+ private long delegateRef;
2667+
2668+ private MacToolbarDelegate delegate;
2669+
2670+ public MacToolbar(){
2671+ super();
2672+ }
2673+
2674+ public void init( Shell shell ) throws Throwable{
2675+ Callback callback = TGCocoa.newCallback( this , "callbackProc64", "callbackProc32", 3 );
2676+ long callbackProc = TGCocoa.getCallbackAddress( callback );
2677+
2678+ if( callbackProc != 0 ){
2679+ String classname = ("MacToolbarDelegate");
2680+ if( TGCocoa.objc_lookUpClass ( classname ) == 0 ) {
2681+ long cls = TGCocoa.objc_allocateClassPair( classname , 0 ) ;
2682+ TGCocoa.class_addIvar(cls, SWT_OBJECT, C.PTR_SIZEOF , (byte)(C.PTR_SIZEOF == 4 ? 2 : 3), new byte[]{'*','\0'} );
2683+ TGCocoa.class_addMethod(cls, sel_toolbarButtonClicked_, callbackProc , "@:@");
2684+ TGCocoa.objc_registerClassPair(cls);
2685+ }
2686+
2687+ this.delegate = TGCocoa.newMacToolbarDelegate();
2688+ this.delegate.alloc().init();
2689+ this.delegateRef = TGCocoa.NewGlobalRef( MacToolbar.this );
2690+
2691+ TGCocoa.object_setInstanceVariable( MacToolbarDelegate.class.getField("id").get( delegate ) , SWT_OBJECT , this.delegateRef );
2692+
2693+ NSToolbar dummyBar = new NSToolbar();
2694+ dummyBar.alloc();
2695+ dummyBar.initWithIdentifier(NSString.stringWith("SWTToolbar")); //$NON-NLS-1$
2696+ dummyBar.setVisible(false);
2697+
2698+ NSWindow nsWindow = shell.view.window();
2699+ nsWindow.setToolbar(dummyBar);
2700+ dummyBar.release();
2701+ nsWindow.setShowsToolbarButton(true);
2702+
2703+ NSButton toolbarButton = TGCocoa.getStandardWindowButton(nsWindow, NSWindowToolbarButton);
2704+ if (toolbarButton != null) {
2705+ toolbarButton.setTarget( delegate );
2706+ TGCocoa.setControlAction( toolbarButton , sel_toolbarButtonClicked_ );
2707+ }
2708+ }
2709+ }
2710+
2711+ public void finalize() throws Throwable{
2712+ if( this.delegateRef != 0 ){
2713+ TGCocoa.DeleteGlobalRef( this.delegateRef );
2714+ this.delegateRef = 0;
2715+ }
2716+ }
2717+
2718+ public long callbackProc( long id, long sel, long arg0 ) {
2719+ if ( this.isEnabled() ){
2720+ if ( sel == sel_toolbarButtonClicked_ ) {
2721+ return handleToogleToolbarCommand();
2722+ }
2723+ }
2724+ return TGCocoa.noErr;
2725+ }
2726+
2727+ public long callbackProc64( long id, long sel, long arg0 ) {
2728+ return this.callbackProc(id, sel, arg0);
2729+ }
2730+
2731+ public int callbackProc32( int id, int sel, int arg0 ) {
2732+ return (int)this.callbackProc( (long)id, (long)sel, (long)arg0);
2733+ }
2734+
2735+ public boolean isEnabled() {
2736+ return this.enabled;
2737+ }
2738+
2739+ public void setEnabled(boolean enabled) {
2740+ this.enabled = enabled;
2741+ }
2742+
2743+ public long handleToogleToolbarCommand(){
2744+ MacToolbarAction.toogleToolbar();
2745+ return TGCocoa.noErr;
2746+ }
2747+}
2748
2749=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarAction.java'
2750--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarAction.java 1970-01-01 00:00:00 +0000
2751+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarAction.java 2010-05-21 18:17:28 +0000
2752@@ -0,0 +1,19 @@
2753+package org.herac.tuxguitar.cocoa.toolbar;
2754+
2755+import org.herac.tuxguitar.gui.TuxGuitar;
2756+import org.herac.tuxguitar.util.TGSynchronizer;
2757+
2758+public class MacToolbarAction {
2759+
2760+ protected static void toogleToolbar(){
2761+ try {
2762+ TGSynchronizer.instance().runLater(new TGSynchronizer.TGRunnable() {
2763+ public void run() throws Throwable {
2764+ TuxGuitar.instance().getItemManager().toogleToolbarVisibility();
2765+ }
2766+ });
2767+ } catch (Throwable e) {
2768+ e.printStackTrace();
2769+ }
2770+ }
2771+}
2772
2773=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarDelegate.java'
2774--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarDelegate.java 1970-01-01 00:00:00 +0000
2775+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarDelegate.java 2010-05-21 18:17:28 +0000
2776@@ -0,0 +1,10 @@
2777+package org.herac.tuxguitar.cocoa.toolbar;
2778+
2779+import org.eclipse.swt.internal.cocoa.NSObject;
2780+
2781+public class MacToolbarDelegate extends NSObject {
2782+
2783+ public MacToolbarDelegate() {
2784+ super();
2785+ }
2786+}
2787
2788=== added file 'TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarPlugin.java'
2789--- TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarPlugin.java 1970-01-01 00:00:00 +0000
2790+++ TuxGuitar-cocoa-integration/src/org/herac/tuxguitar/cocoa/toolbar/MacToolbarPlugin.java 2010-05-21 18:17:28 +0000
2791@@ -0,0 +1,38 @@
2792+package org.herac.tuxguitar.cocoa.toolbar;
2793+
2794+import org.herac.tuxguitar.gui.TuxGuitar;
2795+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
2796+import org.herac.tuxguitar.gui.system.plugins.base.TGPluginAdapter;
2797+
2798+public class MacToolbarPlugin extends TGPluginAdapter {
2799+
2800+ private MacToolbar macToolbar;
2801+
2802+ public void init() throws TGPluginException {
2803+ // Nothing todo
2804+ }
2805+
2806+ public void close() throws TGPluginException {
2807+ try {
2808+ if( this.macToolbar != null ){
2809+ this.macToolbar.finalize();
2810+ }
2811+ } catch( Throwable throwable ){
2812+ throw new TGPluginException( throwable );
2813+ }
2814+ }
2815+
2816+ public void setEnabled(boolean enabled) throws TGPluginException {
2817+ try {
2818+ if( this.macToolbar != null ){
2819+ this.macToolbar.setEnabled(enabled);
2820+ }else if(enabled){
2821+ this.macToolbar = new MacToolbar();
2822+ this.macToolbar.setEnabled(true);
2823+ this.macToolbar.init( TuxGuitar.instance().getShell() );
2824+ }
2825+ } catch( Throwable throwable ){
2826+ throw new TGPluginException( throwable );
2827+ }
2828+ }
2829+}
2830
2831=== added directory 'TuxGuitar-community'
2832=== added file 'TuxGuitar-community/GNUmakefile'
2833--- TuxGuitar-community/GNUmakefile 1970-01-01 00:00:00 +0000
2834+++ TuxGuitar-community/GNUmakefile 2010-05-21 18:17:28 +0000
2835@@ -0,0 +1,84 @@
2836+#------------------------------------------------------------------------------
2837+PACKAGE?=tuxguitar-community
2838+LIBRARY?=lib$(PACKAGE).so
2839+LIBRARY_PROVIDER?=org.herac.tuxguitar.community.TGCommunityPluginImpl
2840+
2841+PREFIX?=/usr
2842+
2843+# dependencies
2844+SWT_PATH?=/usr/share/java/swt.jar
2845+
2846+# tuxguitar paths
2847+TG_SERVICE_CLASS?=org.herac.tuxguitar.gui.system.plugins.TGPlugin
2848+TG_PREFIX?=$(PREFIX)
2849+TG_SOURCE_PATH?=$(TG_PREFIX)/src
2850+TG_LIBRARY_PATH?=$(TG_PREFIX)/lib
2851+TG_NATIVE_PLUGINS_PATH?=$(TG_PREFIX)/share/tuxguitar/plugins
2852+
2853+# install paths
2854+INSTALL_LIBRARY_DIR?=$(TG_NATIVE_PLUGINS_PATH)
2855+INSTALL_SETTINGS_DIR?=$(TG_NATIVE_PLUGINS_PATH)/$(PACKAGE)/
2856+INSTALL_LANGUAGE_DIR?=$(TG_NATIVE_PLUGINS_PATH)/$(PACKAGE)/lang
2857+INSTALL_SERVICE_DIR?=$(TG_NATIVE_PLUGINS_PATH)/$(PACKAGE)/META-INF/services
2858+
2859+# resources
2860+LANGUAGE?=./share/lang
2861+SETTINGS=$(PACKAGE).cfg
2862+DEFAULT_SETTINGS_URL?="community.url=http://community.tuxguitar.com.ar\n"
2863+DEFAULT_SETTINGS_BROWSER?="community.browser=;x-www-browser %s;firefox %s;mozilla %s;mozilla-firefox %s;epiphany-browser %s;epiphany-gecko %s\n"
2864+
2865+# build paths
2866+SOURCE_PATH?=./src/
2867+SOURCES?=$(shell find $(SOURCE_PATH) -name "*.java")
2868+OBJECTS?=$(PACKAGE).o
2869+
2870+GCJ?=gcj
2871+GCJFLAGS+=-fjni -I$(SOURCE_PATH) -I$(TG_SOURCE_PATH) -I$(SWT_PATH)
2872+
2873+default: all
2874+
2875+all: objects library meta-inf settings
2876+
2877+objects: tmp.classes.tmp
2878+
2879+tmp.classes.tmp: $(OBJECTS)
2880+ @touch $@
2881+
2882+library: $(LIBRARY)
2883+
2884+install:
2885+ -install -d $(DESTDIR)$(PREFIX)/
2886+ -install -d $(DESTDIR)$(INSTALL_LIBRARY_DIR)/
2887+ -install -d $(DESTDIR)$(INSTALL_SERVICE_DIR)/
2888+ -install -d $(DESTDIR)$(INSTALL_SETTINGS_DIR)/
2889+ -install -d $(DESTDIR)$(INSTALL_LANGUAGE_DIR)/
2890+ -install $(LIBRARY) $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
2891+ -install $(LANGUAGE)/* $(DESTDIR)$(INSTALL_LANGUAGE_DIR)
2892+ -install $(SETTINGS) $(DESTDIR)$(INSTALL_SETTINGS_DIR)/$(SETTINGS)
2893+ -install $(TG_SERVICE_CLASS) $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
2894+
2895+uninstall:
2896+ -rm $(DESTDIR)$(INSTALL_LIBRARY_DIR)/$(LIBRARY)
2897+ -rm $(DESTDIR)$(INSTALL_SERVICE_DIR)/$(TG_SERVICE_CLASS)
2898+ -rm $(DESTDIR)$(INSTALL_SETTINGS_DIR)/$(SETTINGS)
2899+ -rm $(DESTDIR)$(INSTALL_LANGUAGE_DIR)/*
2900+
2901+clean:
2902+ -@find . -name "*.o" -exec rm -f {} \; > /dev/null 2>&1
2903+ -@find . -name "*.so" -exec rm -f {} \; > /dev/null 2>&1
2904+ -@find . -name "*.tmp" -exec rm -f {} \; > /dev/null 2>&1
2905+ -@rm $(TG_SERVICE_CLASS)
2906+ -@rm $(SETTINGS)
2907+
2908+$(PACKAGE).o: $(SOURCES)
2909+ $(GCJ) $(GCJFLAGS) -c -o $(@F) $^
2910+
2911+$(LIBRARY): $(OBJECTS)
2912+ ${GCJ} -shared -o $@ -ltuxguitar -L$(TG_LIBRARY_PATH) $(^F)
2913+
2914+meta-inf:
2915+ echo $(LIBRARY_PROVIDER) > $(TG_SERVICE_CLASS)
2916+
2917+settings:
2918+ echo $(DEFAULT_SETTINGS_URL) > $(SETTINGS)
2919+ echo $(DEFAULT_SETTINGS_BROWSER) >> $(SETTINGS)
2920
2921=== added file 'TuxGuitar-community/build.properties'
2922--- TuxGuitar-community/build.properties 1970-01-01 00:00:00 +0000
2923+++ TuxGuitar-community/build.properties 2010-05-21 18:17:28 +0000
2924@@ -0,0 +1,23 @@
2925+### ANT Flags
2926+#
2927+# build.compiler=gcj
2928+ant.build.javac.source=1.4
2929+ant.build.javac.target=1.4
2930+
2931+path.tuxguitar=../TuxGuitar/build
2932+path.swt=../TuxGuitar/lib/swt.jar
2933+
2934+
2935+## Default Settings ##
2936+default.community.url=http://community.tuxguitar.com.ar
2937+
2938+default.community.browser=\
2939+;xdg-open %s\
2940+;x-www-browser %s\
2941+;rundll32 url.dll,FileProtocolHandler %s\
2942+;open %s\
2943+;firefox %s\
2944+;mozilla %s\
2945+;mozilla-firefox %s\
2946+;epiphany-browser %s\
2947+;epiphany-gecko %s\
2948
2949=== added file 'TuxGuitar-community/build.xml'
2950--- TuxGuitar-community/build.xml 1970-01-01 00:00:00 +0000
2951+++ TuxGuitar-community/build.xml 2010-05-21 18:17:28 +0000
2952@@ -0,0 +1,63 @@
2953+<?xml version="1.0" encoding="iso-8859-1"?>
2954+
2955+<project name="TuxGuitar-community" basedir="." default="all">
2956+ <description>
2957+ TuxGuitar Community Integration
2958+ </description>
2959+
2960+ <property file="build.properties" />
2961+ <property name="build.src.path" value="src${file.separator}" />
2962+ <property name="build.share.path" value="share${file.separator}" />
2963+ <property name="build.path" value="build${file.separator}" />
2964+ <property name="build.cfg" value="tuxguitar-community.cfg" />
2965+ <property name="build.jar" value="tuxguitar-community.jar" />
2966+
2967+ <property name="service.class" value="org.herac.tuxguitar.gui.system.plugins.TGPlugin" />
2968+ <property name="service.provider" value="org.herac.tuxguitar.community.TGCommunityPluginImpl" />
2969+
2970+ <path id="class.path">
2971+ <pathelement location="${path.tuxguitar}"/>
2972+ <pathelement location="${path.swt}"/>
2973+ </path >
2974+
2975+ <target name="init" depends="clean">
2976+ <mkdir dir="${build.path}" />
2977+ </target>
2978+
2979+ <target name="build" depends="init">
2980+ <echo>+-------------------------------------------------+</echo>
2981+ <echo>| B U I L D I N G P L U G I N |</echo>
2982+ <echo>+-------------------------------------------------+</echo>
2983+
2984+ <javac srcdir="${build.src.path}" destdir="${build.path}" debug="false" >
2985+ <classpath refid="class.path"/>
2986+ <include name="**/*.java"/>
2987+ </javac>
2988+
2989+ <mkdir dir="${build.path}${file.separator}lang" />
2990+ <copy todir="${build.path}${file.separator}lang">
2991+ <fileset dir="${build.share.path}${file.separator}lang"/>
2992+ </copy>
2993+
2994+ <mkdir dir="${build.path}/META-INF/services" />
2995+ <echo file="${build.path}/META-INF/services/${service.class}" append="false">${service.provider}</echo>
2996+
2997+ <touch file="${build.path}/${build.cfg}" />
2998+ <echo file="${build.path}/${build.cfg}" append="true">community.url=${default.community.url}${line.separator}</echo>
2999+ <echo file="${build.path}/${build.cfg}" append="true">community.browser=${default.community.browser}${line.separator}</echo>
3000+
3001+ <echo>+-----------------------------------------------+</echo>
3002+ <echo>| P A C K A G I N G P L U G I N |</echo>
3003+ <echo>+-----------------------------------------------+</echo>
3004+
3005+ <jar destfile="${build.jar}" basedir="${build.path}" />
3006+ <delete quiet="true" dir="${build.path}" />
3007+ </target>
3008+
3009+ <target name="clean">
3010+ <delete quiet="true" dir="${build.path}" />
3011+ <delete quiet="true" file="${build.jar}" />
3012+ </target>
3013+
3014+ <target name="all" depends="build" />
3015+</project>
3016
3017=== added directory 'TuxGuitar-community/share'
3018=== added directory 'TuxGuitar-community/share/lang'
3019=== added file 'TuxGuitar-community/share/lang/messages.properties'
3020--- TuxGuitar-community/share/lang/messages.properties 1970-01-01 00:00:00 +0000
3021+++ TuxGuitar-community/share/lang/messages.properties 2010-05-21 18:17:28 +0000
3022@@ -0,0 +1,25 @@
3023+tuxguitar-community.auth-dialog.title=Sign-In
3024+tuxguitar-community.auth-dialog.signin=My community account
3025+tuxguitar-community.auth-dialog.signin.username=Username
3026+tuxguitar-community.auth-dialog.signin.password=Password
3027+tuxguitar-community.auth-dialog.signup=I'm a new User
3028+tuxguitar-community.auth-dialog.signup.tip=If you don't have a <a href="" >TuxGuitar Community</a> account yet, you can <a href="join">create one now</a>, and start sharing files with the other users. Once you sign in, you'll be able to upload, download, comment and rate files.
3029+
3030+tuxguitar-community.share-dialog.title=Share My Song
3031+tuxguitar-community.share-dialog.details=Song Details
3032+tuxguitar-community.share-dialog.details.user=Username
3033+tuxguitar-community.share-dialog.details.title=Title
3034+tuxguitar-community.share-dialog.details.tagkeys=Tag Keys
3035+tuxguitar-community.share-dialog.details.description=Description
3036+
3037+tuxguitar-community.browser-dialog.title=Shared Tablatures
3038+tuxguitar-community.browser-dialog.account=My Account
3039+tuxguitar-community.browser-dialog.account.user=Username
3040+
3041+tuxguitar-community.welcome-dialog.title=Welcome to the TuxGuitar Community
3042+tuxguitar-community.welcome-dialog.tip-1=Now you can open files from the TuxGuitar Community repository, by using the new Community integration plugin in the TuxGuitar Browser (Tools -> Browser)
3043+tuxguitar-community.welcome-dialog.tip-2=You can easily upload and share your own files with the community (File -> Export -> Share...)
3044+tuxguitar-community.welcome-dialog.tip-bottom=If you don't have a <a href="" >TuxGuitar Community</a> account yet, you can <a href="join">create one now</a>, and start sharing files with the other users. Once you sign in, you'll be able to upload, download, comment and rate files.
3045+tuxguitar-community.welcome-dialog.disable=Do not display this message again
3046+
3047+
3048
3049=== added file 'TuxGuitar-community/share/lang/messages_ca.properties'
3050--- TuxGuitar-community/share/lang/messages_ca.properties 1970-01-01 00:00:00 +0000
3051+++ TuxGuitar-community/share/lang/messages_ca.properties 2010-05-21 18:17:28 +0000
3052@@ -0,0 +1,23 @@
3053+tuxguitar-community.auth-dialog.title=Feu l'entrada
3054+tuxguitar-community.auth-dialog.signin=El compte de la meva comunitat
3055+tuxguitar-community.auth-dialog.signin.username=Usuari
3056+tuxguitar-community.auth-dialog.signin.password=Paraula de pas
3057+tuxguitar-community.auth-dialog.signup=S\u00F3c un nou usuari
3058+tuxguitar-community.auth-dialog.signup.tip=Si encara no teniu un compte a la <a href="" >Comunitat TuxGuitar</a>, podeu <a href="join">crear-ne un de nou ara</a>, i comen\u00E7ar a compartir arxius amb altres usuaris. Un cop feu l'entrada, podreu pujar, descarregar, comentar i valorar arxius.
3059+
3060+tuxguitar-community.share-dialog.title=Compartir la meva can\u00E7\u00F3
3061+tuxguitar-community.share-dialog.details=Detalls de la can\u00E7\u00F3
3062+tuxguitar-community.share-dialog.details.user=Usuari
3063+tuxguitar-community.share-dialog.details.title=T\u00EDtol
3064+tuxguitar-community.share-dialog.details.tagkeys=Tag Keys
3065+tuxguitar-community.share-dialog.details.description=Descripci\u00F3
3066+
3067+tuxguitar-community.browser-dialog.title=Tabulatures compartides
3068+tuxguitar-community.browser-dialog.account=El meu compte
3069+tuxguitar-community.browser-dialog.account.user=Usuari
3070+
3071+tuxguitar-community.welcome-dialog.title=Benvingut a la Comunitat TuxGuitar
3072+tuxguitar-community.welcome-dialog.tip-1=Ara podeu obrir arxius des del repositori de la Comunitat TuxGuitar, fent \u00FAs del nou endollable d'integraci\u00F3 a la Comunitat al Navegador TuxGuitar (Eines -> Navegador)
3073+tuxguitar-community.welcome-dialog.tip-2=Podeu pujar i compartir f\u00E0cilment els vostres propis arxius amb la comunitat (Arxiu -> Exportar -> Compartir...)
3074+tuxguitar-community.welcome-dialog.tip-bottom=Si encara no teniu un compte a la <a href="" >Comunitat TuxGuitar</a>, podeu <a href="join">crear-ne un de nou ara</a>, i comen\u00E7ar a compartir arxius amb altres usuaris. Un cop feu l'entrada, podreu pujar, descarregar, comentar i valorar arxius.
3075+tuxguitar-community.welcome-dialog.disable=No mostrar aquest missage de nou.
3076
3077=== added file 'TuxGuitar-community/share/lang/messages_en.properties'
3078--- TuxGuitar-community/share/lang/messages_en.properties 1970-01-01 00:00:00 +0000
3079+++ TuxGuitar-community/share/lang/messages_en.properties 2010-05-21 18:17:28 +0000
3080@@ -0,0 +1,25 @@
3081+tuxguitar-community.auth-dialog.title=Sign-In
3082+tuxguitar-community.auth-dialog.signin=My community account
3083+tuxguitar-community.auth-dialog.signin.username=Username
3084+tuxguitar-community.auth-dialog.signin.password=Password
3085+tuxguitar-community.auth-dialog.signup=I'm a new User
3086+tuxguitar-community.auth-dialog.signup.tip=If you don't have a <a href="" >TuxGuitar Community</a> account yet, you can <a href="join">create one now</a>, and start sharing files with the other users. Once you sign in, you'll be able to upload, download, comment and rate files.
3087+
3088+tuxguitar-community.share-dialog.title=Share My Song
3089+tuxguitar-community.share-dialog.details=Song Details
3090+tuxguitar-community.share-dialog.details.user=Username
3091+tuxguitar-community.share-dialog.details.title=Title
3092+tuxguitar-community.share-dialog.details.tagkeys=Tag Keys
3093+tuxguitar-community.share-dialog.details.description=Description
3094+
3095+tuxguitar-community.browser-dialog.title=Shared Tablatures
3096+tuxguitar-community.browser-dialog.account=My Account
3097+tuxguitar-community.browser-dialog.account.user=Username
3098+
3099+tuxguitar-community.welcome-dialog.title=Welcome to the TuxGuitar Community
3100+tuxguitar-community.welcome-dialog.tip-1=Now you can open files from the TuxGuitar Community repository, by using the new Community integration plugin in the TuxGuitar Browser (Tools -> Browser)
3101+tuxguitar-community.welcome-dialog.tip-2=You can easily upload and share your own files with the community (File -> Export -> Share...)
3102+tuxguitar-community.welcome-dialog.tip-bottom=If you don't have a <a href="" >TuxGuitar Community</a> account yet, you can <a href="join">create one now</a>, and start sharing files with the other users. Once you sign in, you'll be able to upload, download, comment and rate files.
3103+tuxguitar-community.welcome-dialog.disable=Do not display this message again
3104+
3105+
3106
3107=== added file 'TuxGuitar-community/share/lang/messages_es.properties'
3108--- TuxGuitar-community/share/lang/messages_es.properties 1970-01-01 00:00:00 +0000
3109+++ TuxGuitar-community/share/lang/messages_es.properties 2010-05-21 18:17:28 +0000
3110@@ -0,0 +1,23 @@
3111+tuxguitar-community.auth-dialog.title=Iniciar sesi\u00F3n
3112+tuxguitar-community.auth-dialog.signin=Mi cuenta
3113+tuxguitar-community.auth-dialog.signin.username=Usuario
3114+tuxguitar-community.auth-dialog.signin.password=Contrase\u00F1a
3115+tuxguitar-community.auth-dialog.signup=No dispongo de una cuenta en la comunidad
3116+tuxguitar-community.auth-dialog.signup.tip=Si no tiene una cuenta en la <a href="" >Comunidad de TuxGuitar</a>, puede <a href="join">crearla ahora!</a>. Uni\u00E9ndose a esta comunidad, podr\u00E1 subir y descargar tablaturas compartidas
3117+
3118+tuxguitar-community.share-dialog.title=Compartir mi tablatura
3119+tuxguitar-community.share-dialog.details=Detalles
3120+tuxguitar-community.share-dialog.details.user=Usuario
3121+tuxguitar-community.share-dialog.details.title=T\u00EDtulo
3122+tuxguitar-community.share-dialog.details.tagkeys=Tags
3123+tuxguitar-community.share-dialog.details.description=Descripci\u00F3n
3124+
3125+tuxguitar-community.browser-dialog.title=Tablaturas compartidas
3126+tuxguitar-community.browser-dialog.account=Mi cuenta
3127+tuxguitar-community.browser-dialog.account.user=Usuario
3128+
3129+tuxguitar-community.welcome-dialog.title=Bienvenido a la comunidad de TuxGuitar
3130+tuxguitar-community.welcome-dialog.tip-1=Ahora podr\u00E1 abrir tablaturas compartidas en el explorador de canciones (Herramientas -> Explorador de Canciones ) gracias al nuevo plugin de integraci\u00F3n con la comunidad.
3131+tuxguitar-community.welcome-dialog.tip-2=Tambi\u00E9n podr\u00E1 compartir sus tablaturas con la comunidad de manera sencilla ( Archivo -> Exportar -> Share with the Community )
3132+tuxguitar-community.welcome-dialog.tip-bottom=Si no tiene una cuenta en la <a href="" >Comunidad de TuxGuitar</a>, puede <a href="join">crearla ahora!</a>. Uniendose a esta comunidad, podr\u00E1 subir y descargar tablaturas compartidas
3133+tuxguitar-community.welcome-dialog.disable=No volver a mostrar este mensaje.
3134
3135=== added file 'TuxGuitar-community/share/lang/messages_eu.properties'
3136--- TuxGuitar-community/share/lang/messages_eu.properties 1970-01-01 00:00:00 +0000
3137+++ TuxGuitar-community/share/lang/messages_eu.properties 2010-05-21 18:17:28 +0000
3138@@ -0,0 +1,23 @@
3139+tuxguitar-community.auth-dialog.title=Sartu
3140+tuxguitar-community.auth-dialog.signin=Nire komunitatearen Kontua
3141+tuxguitar-community.auth-dialog.signin.username=Izena
3142+tuxguitar-community.auth-dialog.signin.password=Password
3143+tuxguitar-community.auth-dialog.signup=Berria nahiz
3144+tuxguitar-community.auth-dialog.signup.tip=Ez baduzu <a href="" >TuxGuitar Community</a>-ko konturik, <a href="join">egin bat</a>, eta hasi komunitateko beste erabiltzailekin abestiak banatzen. Kontua egin eta gero abestiak, jarri,deskargatu, komentatu, eta puntuatzeko gai izango zara.
3145+
3146+tuxguitar-community.share-dialog.title=Nire abestia besteekin banatu
3147+tuxguitar-community.share-dialog.details=Abestiaren propietateak
3148+tuxguitar-community.share-dialog.details.user=Erabiltzailea
3149+tuxguitar-community.share-dialog.details.title=Izenburua
3150+tuxguitar-community.share-dialog.details.tagkeys=Hitz klabeak
3151+tuxguitar-community.share-dialog.details.description=Deskribapena
3152+
3153+tuxguitar-community.browser-dialog.title=Nire Tablaturak
3154+tuxguitar-community.browser-dialog.account=Nire kontua
3155+tuxguitar-community.browser-dialog.account.user=Izena
3156+
3157+tuxguitar-community.welcome-dialog.title=Ongi etorri TuxGuitar-eko komunitatera!
3158+tuxguitar-community.welcome-dialog.tip-1=Horain TuxGuitareko kommunitatean dauden abestiak irekitzeko gai izango zara komunitate-integrazio pluginari bidez (Tresnak -> Abesti esploratzailea)
3159+tuxguitar-community.welcome-dialog.tip-2=Oso erraza da abestiak igotzea eta komunitatearekin banatu(Fitxategia -> Exportatu -> Banatu...)
3160+tuxguitar-community.welcome-dialog.tip-bottom=Ez baduzu <a href="" >TuxGuitar Community</a>-ko konturik, <a href="join">egin bat</a>, eta hasi komunitateko beste erabiltzailekin abestiak banatzen. Kontua egin eta gero, jarri,deskargatu, komentatu, eta puntuatzeko gai izango zara.
3161+tuxguitar-community.welcome-dialog.disable=Leiho hau ez nahi dut berriro ikusi
3162
3163=== added file 'TuxGuitar-community/share/lang/messages_ja.properties'
3164--- TuxGuitar-community/share/lang/messages_ja.properties 1970-01-01 00:00:00 +0000
3165+++ TuxGuitar-community/share/lang/messages_ja.properties 2010-05-21 18:17:28 +0000
3166@@ -0,0 +1,23 @@
3167+tuxguitar-community.auth-dialog.title=\u30b5\u30a4\u30f3\u30a4\u30f3
3168+tuxguitar-community.auth-dialog.signin=\u30de\u30a4\u30fb\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30fb\u30a2\u30ab\u30a6\u30f3\u30c8
3169+tuxguitar-community.auth-dialog.signin.username=\u30e6\u30fc\u30b6\u30cd\u30fc\u30e0
3170+tuxguitar-community.auth-dialog.signin.password=\u30d1\u30b9\u30ef\u30fc\u30c9
3171+tuxguitar-community.auth-dialog.signup=\u65b0\u898f\u30e6\u30fc\u30b6\u767b\u9332
3172+tuxguitar-community.auth-dialog.signup.tip=\u3082\u3057 <a href="" >TuxGuitar Community</a> \u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u307e\u3060\u53d6\u5f97\u3057\u3066\u3044\u306a\u3044\u306a\u3089\uff0c <a href="\u53c2\u52a0">\u65b0\u898f\u767b\u9332</a> \u3057\u3066\uff0c\u4ed6\u306e\u30e6\u30fc\u30b6\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u5171\u6709\u3092\u59cb\u3081\u3088\u3046\u3002 \u4e00\u5ea6\u30b5\u30a4\u30f3\u30a4\u30f3\u3059\u308c\u3070\uff0c \u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\uff0c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\uff0c\u30b3\u30e1\u30f3\u30c8\u3084\u8a55\u4fa1\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002
3173+
3174+tuxguitar-community.share-dialog.title=\u697d\u66f2\u3092\u5171\u6709\u3059\u308b
3175+tuxguitar-community.share-dialog.details=\u697d\u66f2\u306e\u8a73\u7d30
3176+tuxguitar-community.share-dialog.details.user=\u30e6\u30fc\u30b6\u30cd\u30fc\u30e0
3177+tuxguitar-community.share-dialog.details.title=\u30bf\u30a4\u30c8\u30eb
3178+tuxguitar-community.share-dialog.details.tagkeys=\u30bf\u30b0\u30fb\u30ad\u30fc
3179+tuxguitar-community.share-dialog.details.description=\u8a73\u7d30
3180+
3181+tuxguitar-community.browser-dialog.title=TAB\u8b5c\u3092\u5171\u6709\u3059\u308b
3182+tuxguitar-community.browser-dialog.account=\u30de\u30a4\u30fb\u30a2\u30ab\u30a6\u30f3\u30c8
3183+tuxguitar-community.browser-dialog.account.user=\u30e6\u30fc\u30b6\u30cd\u30fc\u30e0
3184+
3185+tuxguitar-community.welcome-dialog.title=\u3088\u3046\u3053\u305dTuxGuitar Community\u3078
3186+tuxguitar-community.welcome-dialog.tip-1=TuxGuitar\u30d6\u30e9\u30a6\u30b6\uff08\u30c4\u30fc\u30eb -> \u30d6\u30e9\u30a6\u30b6\uff09\u306b\u7d71\u5408\u3055\u308c\u305f\u65b0\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u30fb\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\uff0cTuxGuitar Community \u306e\u4fdd\u7ba1\u5eab\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002
3187+tuxguitar-community.welcome-dialog.tip-2=\u81ea\u8eab\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3078\u7c21\u5358\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\uff0c\u5171\u6709\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff08\u30d5\u30a1\u30a4\u30eb -> \u30a8\u30af\u30b9\u30dd\u30fc\u30c8 -> \u30b7\u30a7\u30a2...\uff09\u3002
3188+tuxguitar-community.welcome-dialog.tip-bottom=\u3082\u3057 <a href="" >TuxGuitar Community</a> \u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u307e\u3060\u53d6\u5f97\u3057\u3066\u3044\u306a\u3044\u306a\u3089\uff0c <a href="\u53c2\u52a0">\u65b0\u898f\u767b\u9332</a> \u3057\u3066\uff0c\u4ed6\u306e\u30e6\u30fc\u30b6\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u5171\u6709\u3092\u59cb\u3081\u3088\u3046\u3002 \u4e00\u5ea6\u30b5\u30a4\u30f3\u30a4\u30f3\u3059\u308c\u3070\uff0c \u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\uff0c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\uff0c\u30b3\u30e1\u30f3\u30c8\u3084\u8a55\u4fa1\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002
3189+tuxguitar-community.welcome-dialog.disable=\u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u518d\u5ea6\u8868\u793a\u3057\u306a\u3044
3190
3191=== added file 'TuxGuitar-community/share/lang/messages_pl.properties'
3192--- TuxGuitar-community/share/lang/messages_pl.properties 1970-01-01 00:00:00 +0000
3193+++ TuxGuitar-community/share/lang/messages_pl.properties 2010-05-21 18:17:28 +0000
3194@@ -0,0 +1,23 @@
3195+tuxguitar-community.auth-dialog.title=Zaloguj
3196+tuxguitar-community.auth-dialog.signin=Moje konto
3197+tuxguitar-community.auth-dialog.signin.username=Nazwa u\u017cytkownika
3198+tuxguitar-community.auth-dialog.signin.password=Has\u0142o
3199+tuxguitar-community.auth-dialog.signup=Jestem nowy
3200+tuxguitar-community.auth-dialog.signup.tip=Je\u017celi nie masz jeszcze konta w<a href="" >Spo\u0142eczno\u015bci TuxGuitar</a>, mo\u017cesz <a href="join">stworzy\u0107 je teraz</a>, i zacz\u0105\u0107 dzieli\u0107 si\u0119 plikami z innymi u\u017cytkownikami. Kiedy si\u0119 zalogujesz, b\u0119dziesz m\u00f3g\u0142 je wysy\u0142a\u0107, pobiera\u0107, komentowa\u0107 i ocenia\u0107.
3201+
3202+tuxguitar-community.share-dialog.title=Udost\u0119pnij m\u00f3j utw\u00f3r
3203+tuxguitar-community.share-dialog.details=Szczeg\u00f3\u0142y utworu
3204+tuxguitar-community.share-dialog.details.user=Nazwa u\u017cytkownika
3205+tuxguitar-community.share-dialog.details.title=Tytu\u0142
3206+tuxguitar-community.share-dialog.details.tagkeys=S\u0142owa kluczowe
3207+tuxguitar-community.share-dialog.details.description=Opis
3208+
3209+tuxguitar-community.browser-dialog.title=Udost\u0119pnione tabulatury
3210+tuxguitar-community.browser-dialog.account=Moje konto
3211+tuxguitar-community.browser-dialog.account.user=Nazwa u\u017cytkownika
3212+
3213+tuxguitar-community.welcome-dialog.title=Witamy w Spo\u0142eczno\u015bci TuxGuitar
3214+tuxguitar-community.welcome-dialog.tip-1=Teraz mo\u017cesz otwiera\u0107 pliki z repozytorium u\u017cytkownik\u00f3w TuxGuitar, u\u017cywaj\u0105c nowej wtyczki integruj\u0105cej u\u017cytkownik\u00f3w w Przegl\u0105darce plik\u00f3w (Narz\u0119dzia -> Przegl\u0105darka)
3215+tuxguitar-community.welcome-dialog.tip-2=Mo\u017cesz w \u0142atwy spos\u00f3b pobra\u0107 i udost\u0119pni\u0107 swoje pliki z innymi cz\u0142onkami Spo\u0142eczno\u015bci (Plik-> Eksport -> Udost\u0119pnij Spo\u0142eczno\u015bci
3216+tuxguitar-community.welcome-dialog.tip-bottom=Je\u017celi nie masz jeszcze konta w<a href="" >Spo\u0142eczno\u015bci TuxGuitar</a>, mo\u017cesz <a href="join">stworzy\u0107 je teraz</a>, i zacz\u0105\u0107 dzieli\u0107 si\u0119 plikami z innymi u\u017cytkownikami. Kiedy si\u0119 zalogujesz, b\u0119dziesz m\u00f3g\u0142 je wysy\u0142a\u0107, pobiera\u0107, komentowa\u0107 i ocenia\u0107.
3217+tuxguitar-community.welcome-dialog.disable=Nie wy\u015bwietlaj wi\u0119cej tego komunikatu
3218
3219=== added file 'TuxGuitar-community/share/lang/messages_pt.properties'
3220--- TuxGuitar-community/share/lang/messages_pt.properties 1970-01-01 00:00:00 +0000
3221+++ TuxGuitar-community/share/lang/messages_pt.properties 2010-05-21 18:17:28 +0000
3222@@ -0,0 +1,23 @@
3223+tuxguitar-community.auth-dialog.title=Participar
3224+tuxguitar-community.auth-dialog.signin=Minha conta na Comunidade
3225+tuxguitar-community.auth-dialog.signin.username=Usuário
3226+tuxguitar-community.auth-dialog.signin.password=Senha
3227+tuxguitar-community.auth-dialog.signup=Sou um novo usuário
3228+tuxguitar-community.auth-dialog.signup.tip=Se você ainda não tem uma conta na <a href="" >Comunidade TuxGuitar</a>, você pode <a href="join">criar uma agora</a>, e trocar arquivos com outros usuários. Basta se inscrever, e poderá enviar, baixar, comentar e avaliar arquivos.
3229+
3230+tuxguitar-community.share-dialog.title=Compartilhar minha música
3231+tuxguitar-community.share-dialog.details=Detalhes da música
3232+tuxguitar-community.share-dialog.details.user=Usuário
3233+tuxguitar-community.share-dialog.details.title=Título
3234+tuxguitar-community.share-dialog.details.tagkeys=Palavras-chave
3235+tuxguitar-community.share-dialog.details.description=Descrição
3236+
3237+tuxguitar-community.browser-dialog.title=Tablaturas compartilhadas
3238+tuxguitar-community.browser-dialog.account=Minha conta
3239+tuxguitar-community.browser-dialog.account.user=Usuário
3240+
3241+tuxguitar-community.welcome-dialog.title=Bem-vindo à Comunidade TuxGuitar
3242+tuxguitar-community.welcome-dialog.tip-1=Agora você pode abrir arquivos do repositório da Comunidade TuxGuitar, usando o novo plugin de integração com a Comunidade, no navegador TuxGuitar (Ferramentas -> Navegador)
3243+tuxguitar-community.welcome-dialog.tip-2=Você pode facilmante compartilhar seus arquivos (Arquivo -> Exportar -> Compartilhar...)
3244+tuxguitar-community.welcome-dialog.tip-bottom=Se você ainda não tem uma conta na <a href="" >Comunidade TuxGuitar</a>, você pode <a href="join">criar uma agora</a>, e trocar arquivos com outros usuários. Basta se inscrever, e poderá enviar, baixar, comentar e avaliar arquivos.
3245+tuxguitar-community.welcome-dialog.disable=Não exibir essa mensagem novamente
3246
3247=== added file 'TuxGuitar-community/share/lang/messages_sv.properties'
3248--- TuxGuitar-community/share/lang/messages_sv.properties 1970-01-01 00:00:00 +0000
3249+++ TuxGuitar-community/share/lang/messages_sv.properties 2010-05-21 18:17:28 +0000
3250@@ -0,0 +1,29 @@
3251+# Swedish translation for TuxGuitar's Community plugin.
3252+# Copyright (C) 2009 Free Software Foundation, Inc.
3253+# This file is distributed under the same license as the TuxGuitar software.
3254+# John Gustafsson <jamminjohn@users.sourceforge.net>, 2009.
3255+#
3256+
3257+tuxguitar-community.auth-dialog.title=Logga in
3258+tuxguitar-community.auth-dialog.signin=Mitt communitykonto
3259+tuxguitar-community.auth-dialog.signin.username=Anv\u00e4ndarnamn
3260+tuxguitar-community.auth-dialog.signin.password=L\u00f6senord
3261+tuxguitar-community.auth-dialog.signup=Jag \u00e4r en ny anv\u00e4ndare
3262+tuxguitar-community.auth-dialog.signup.tip=Om du inte har ett <a href="" >TuxGuitar Community</a>-konto \u00e4n kan du <a href="join">skapa ett nu</a> och b\u00f6rja dela filer med andra anv\u00e4ndare. N\u00e4r du v\u00e4l har loggat in kan du ladda upp, h\u00e4mta, kommentera och betygs\u00e4tta filer.
3263+
3264+tuxguitar-community.share-dialog.title=Dela mina l\u00e5tar
3265+tuxguitar-community.share-dialog.details=L\u00e5tdetaljer
3266+tuxguitar-community.share-dialog.details.user=Anv\u00e4ndarnamn
3267+tuxguitar-community.share-dialog.details.title=Titel
3268+tuxguitar-community.share-dialog.details.tagkeys=Taggar
3269+tuxguitar-community.share-dialog.details.description=Beskrivning
3270+
3271+tuxguitar-community.browser-dialog.title=Delade tabulaturer
3272+tuxguitar-community.browser-dialog.account=Mitt konto
3273+tuxguitar-community.browser-dialog.account.user=Anv\u00e4ndarnamn
3274+
3275+tuxguitar-community.welcome-dialog.title=V\u00e4lkommen till TuxGuitar Community
3276+tuxguitar-community.welcome-dialog.tip-1=Nu kan du \u00f6ppna filer i TuxGuitar Community-f\u00f6rr\u00e5det genom att anv\u00e4nda den nya instickmodulen f\u00f6r community-integration i TuxGuitar-bl\u00e4ddraren (Verktyg -> Bl\u00e4ddrare)
3277+tuxguitar-community.welcome-dialog.tip-2=Du kan enkelt ladda upp och dela dina egna filer med communityt (Arkiv -> Exportera -> Dela...)
3278+tuxguitar-community.welcome-dialog.tip-bottom=Om du inte har ett <a href="" >TuxGuitar Community</a>-konto \u00e4n kan du <a href="join">skapa ett nu</a> och b\u00f6rja dela filer med andra anv\u00e4ndare. N\u00e4r du v\u00e4l har loggat in kan du ladda upp, h\u00e4mta, kommentera och betygs\u00e4tta filer.
3279+tuxguitar-community.welcome-dialog.disable=Visa inte detta meddelande igen
3280
3281=== added file 'TuxGuitar-community/share/lang/messages_zh_GB.properties'
3282--- TuxGuitar-community/share/lang/messages_zh_GB.properties 1970-01-01 00:00:00 +0000
3283+++ TuxGuitar-community/share/lang/messages_zh_GB.properties 2010-05-21 18:17:28 +0000
3284@@ -0,0 +1,23 @@
3285+tuxguitar-community.auth-dialog.title=\u767B\u5F55
3286+tuxguitar-community.auth-dialog.signin=\u6211\u7684\u8D26\u53F7
3287+tuxguitar-community.auth-dialog.signin.username=\u7528\u6237\u540D
3288+tuxguitar-community.auth-dialog.signin.password=\u5BC6\u7801
3289+tuxguitar-community.auth-dialog.signup=\u6211\u662F\u65B0\u7528\u6237
3290+tuxguitar-community.auth-dialog.signup.tip=\u5982\u679C\u4F60\u8FD8\u6CA1\u6709TuxGutiar<a href="" >\u793E\u533A\u5E10\u53F7</a>, <a href="join">\u70B9\u51FB\u8FD9\u91CC\u6CE8\u518C</a>.\u767B\u5F55\u540E\u5C31\u53EF\u4EE5\u4E0A\u4F20,\u4E0B\u8F7D,\u53D1\u8868\u610F\u89C1,\u8FD8\u80FD\u4E3A\u66F2\u8C31\u6253\u5206.
3291+
3292+tuxguitar-community.share-dialog.title=\u5206\u4EAB\u97F3\u4E50
3293+tuxguitar-community.share-dialog.details=\u6B4C\u66F2\u7EC6\u8282
3294+tuxguitar-community.share-dialog.details.user=\u7528\u6237\u540D
3295+tuxguitar-community.share-dialog.details.title=\u6B4C\u66F2\u540D
3296+tuxguitar-community.share-dialog.details.tagkeys=\u5173\u952E\u5B57
3297+tuxguitar-community.share-dialog.details.description=\u63CF\u8FF0
3298+
3299+tuxguitar-community.browser-dialog.title=\u5206\u4EAB\u66F2\u8C31
3300+tuxguitar-community.browser-dialog.account=\u6211\u7684\u8D26\u6237
3301+tuxguitar-community.browser-dialog.account.user=\u7528\u6237\u540D
3302+
3303+tuxguitar-community.welcome-dialog.title=\u6B22\u8FCE\u6765\u5230TuxGuitar\u793E\u533A
3304+tuxguitar-community.welcome-dialog.tip-1=\u60A8\u53EF\u4EE5\u7528\u672C\u8F6F\u4EF6\u6253\u5F00\u793E\u533A\u8D44\u6E90\u5E93, \u53EA\u9700\u901A\u8FC7\u65B0\u529F\u80FD"\u793E\u533A\u6574\u5408"\u63D2\u4EF6\u5373\u53EF.(\u5355\u51FB\u83DC\u5355\u680F \u5DE5\u5177->\u6D4F\u89C8\u5668)
3305+tuxguitar-community.welcome-dialog.tip-2=\u60A8\u53EF\u4EE5\u5F88\u5BB9\u6613\u901A\u8FC7\u793E\u533A\u4E0A\u4F20\u548C\u5171\u4EAB\u4F60\u7684\u6587\u4EF6.(\u5355\u51FB\u83DC\u5355\u680F \u6587\u4EF6->\u5BFC\u51FA->\u5171\u4EAB...)
3306+tuxguitar-community.welcome-dialog.tip-bottom=\u5982\u679C\u4F60\u8FD8\u6CA1\u6709TuxGutiar<a href="" >\u793E\u533A\u5E10\u53F7</a>, <a href="join">\u70B9\u51FB\u8FD9\u91CC\u6CE8\u518C</a>.\u767B\u540E\u5C31\u53EF\u4EE5\u4E0A\u4F20,\u4E0B\u8F7D,\u53D1\u8868\u610F\u89C1,\u8FD8\u80FD\u4E3A\u66F2\u8C31\u6253\u5206.
3307+tuxguitar-community.welcome-dialog.disable=\u4E0D\u518D\u663E\u793A\u5F53\u524D\u4FE1\u606F
3308
3309=== added directory 'TuxGuitar-community/src'
3310=== added directory 'TuxGuitar-community/src/org'
3311=== added directory 'TuxGuitar-community/src/org/herac'
3312=== added directory 'TuxGuitar-community/src/org/herac/tuxguitar'
3313=== added directory 'TuxGuitar-community/src/org/herac/tuxguitar/community'
3314=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunityPluginImpl.java'
3315--- TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunityPluginImpl.java 1970-01-01 00:00:00 +0000
3316+++ TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunityPluginImpl.java 2010-05-21 18:17:28 +0000
3317@@ -0,0 +1,49 @@
3318+package org.herac.tuxguitar.community;
3319+
3320+import java.util.ArrayList;
3321+import java.util.List;
3322+
3323+import org.herac.tuxguitar.community.browser.TGBrowserPluginImpl;
3324+import org.herac.tuxguitar.community.io.TGShareSongPlugin;
3325+import org.herac.tuxguitar.community.startup.TGCommunityStartupPlugin;
3326+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
3327+import org.herac.tuxguitar.gui.system.plugins.base.TGPluginList;
3328+
3329+public class TGCommunityPluginImpl extends TGPluginList {
3330+
3331+ protected List getPlugins() throws TGPluginException {
3332+ List plugins = new ArrayList();
3333+
3334+ plugins.add(new TGShareSongPlugin());
3335+ plugins.add(new TGBrowserPluginImpl());
3336+ plugins.add(new TGCommunityStartupPlugin());
3337+
3338+ return plugins;
3339+ }
3340+
3341+ public void init() throws TGPluginException{
3342+ TGCommunitySingleton.getInstance().loadSettings();
3343+ super.init();
3344+ }
3345+
3346+ public void close() throws TGPluginException{
3347+ TGCommunitySingleton.getInstance().saveSettings();
3348+ super.close();
3349+ }
3350+
3351+ public String getName() {
3352+ return "TuxGuitar Community Integration";
3353+ }
3354+
3355+ public String getDescription() {
3356+ return "TuxGuitar Community Integration";
3357+ }
3358+
3359+ public String getAuthor() {
3360+ return "Julian Casadesus <julian@casadesus.com.ar>";
3361+ }
3362+
3363+ public String getVersion() {
3364+ return "1.2";
3365+ }
3366+}
3367
3368=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunitySingleton.java'
3369--- TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunitySingleton.java 1970-01-01 00:00:00 +0000
3370+++ TuxGuitar-community/src/org/herac/tuxguitar/community/TGCommunitySingleton.java 2010-05-21 18:17:28 +0000
3371@@ -0,0 +1,49 @@
3372+package org.herac.tuxguitar.community;
3373+
3374+import org.herac.tuxguitar.community.auth.TGCommunityAuth;
3375+import org.herac.tuxguitar.gui.system.config.TGConfigManager;
3376+import org.herac.tuxguitar.gui.system.plugins.TGPluginConfigManager;
3377+
3378+public class TGCommunitySingleton {
3379+
3380+ private static TGCommunitySingleton instance;
3381+
3382+ private TGConfigManager config;
3383+ private TGCommunityAuth auth;
3384+
3385+ private TGCommunitySingleton(){
3386+ this.auth = new TGCommunityAuth();
3387+ }
3388+
3389+ public static TGCommunitySingleton getInstance() {
3390+ synchronized ( TGCommunitySingleton.class ) {
3391+ if( instance == null ){
3392+ instance = new TGCommunitySingleton();
3393+ }
3394+ }
3395+ return instance;
3396+ }
3397+
3398+ public TGConfigManager getConfig(){
3399+ if(this.config == null){
3400+ this.config = new TGPluginConfigManager("tuxguitar-community");
3401+ this.config.init();
3402+ }
3403+ return this.config;
3404+ }
3405+
3406+ public void loadSettings(){
3407+ TGConfigManager config = getConfig();
3408+ this.auth.load( config );
3409+ }
3410+
3411+ public void saveSettings(){
3412+ TGConfigManager config = getConfig();
3413+ this.auth.save( config );
3414+ config.save();
3415+ }
3416+
3417+ public TGCommunityAuth getAuth(){
3418+ return this.auth;
3419+ }
3420+}
3421
3422=== added directory 'TuxGuitar-community/src/org/herac/tuxguitar/community/auth'
3423=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuth.java'
3424--- TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuth.java 1970-01-01 00:00:00 +0000
3425+++ TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuth.java 2010-05-21 18:17:28 +0000
3426@@ -0,0 +1,82 @@
3427+package org.herac.tuxguitar.community.auth;
3428+
3429+import java.security.MessageDigest;
3430+
3431+import org.herac.tuxguitar.community.auth.utils.Base64Decoder;
3432+import org.herac.tuxguitar.community.auth.utils.Base64Encoder;
3433+import org.herac.tuxguitar.gui.system.config.TGConfigManager;
3434+
3435+public class TGCommunityAuth {
3436+
3437+ private static final String STRING_SEPARATOR = ";";
3438+
3439+ private String username;
3440+ private String password;
3441+ private String authCode;
3442+
3443+ public TGCommunityAuth(){
3444+ this.username = new String();
3445+ this.password = new String();
3446+ this.authCode = new String();
3447+ }
3448+
3449+ public String getUsername() {
3450+ return username;
3451+ }
3452+
3453+ public void setUsername(String username) {
3454+ this.username = username;
3455+ }
3456+
3457+ public String getPassword() {
3458+ return password;
3459+ }
3460+
3461+ public void setPassword(String password) {
3462+ this.password = password;
3463+ }
3464+
3465+ public String getAuthCode() {
3466+ return this.authCode;
3467+ }
3468+
3469+ public boolean isEmpty(){
3470+ return ( this.username == null || this.password == null || this.username.length() == 0 || this.password.length() == 0 );
3471+ }
3472+
3473+ public void update(){
3474+ try {
3475+ String passwordMD5 = new String();
3476+ if( this.password != null && this.password.length() > 0 ){
3477+ MessageDigest md = MessageDigest.getInstance("md5");
3478+ md.update(this.password.getBytes());
3479+ byte[] digest = md.digest();
3480+ for (int i = 0; i < digest.length; i++){
3481+ passwordMD5 += Integer.toHexString((digest[i] >> 4) & 0xf);
3482+ passwordMD5 += Integer.toHexString((digest[i] & 0xf));
3483+ }
3484+ }
3485+ this.authCode = new String(Base64Encoder.encode( new String(this.username + ";" + passwordMD5 ).getBytes() ) );
3486+ } catch (Throwable throwable) {
3487+ throwable.printStackTrace();
3488+ }
3489+ }
3490+
3491+ public void save( TGConfigManager config ){
3492+ String data = new String(this.getUsername() + STRING_SEPARATOR + this.getPassword() );
3493+ String encodedData = new String(Base64Encoder.encode( data.getBytes() ) ) ;
3494+ config.setProperty("community.account", encodedData );
3495+ }
3496+
3497+ public void load( TGConfigManager config ) {
3498+ String encodedData = config.getStringConfigValue("community.account");
3499+ if( encodedData != null && encodedData.length() > 0 ){
3500+ String data = new String(Base64Decoder.decode( encodedData.getBytes() ));
3501+ String[] values = data.split(STRING_SEPARATOR);
3502+ if(values.length == 2){
3503+ this.setUsername( values[0] );
3504+ this.setPassword( values[1] );
3505+ }
3506+ }
3507+ }
3508+}
3509
3510=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuthDialog.java'
3511--- TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuthDialog.java 1970-01-01 00:00:00 +0000
3512+++ TuxGuitar-community/src/org/herac/tuxguitar/community/auth/TGCommunityAuthDialog.java 2010-05-21 18:17:28 +0000
3513@@ -0,0 +1,176 @@
3514+package org.herac.tuxguitar.community.auth;
3515+
3516+import org.eclipse.swt.SWT;
3517+import org.eclipse.swt.events.SelectionAdapter;
3518+import org.eclipse.swt.events.SelectionEvent;
3519+import org.eclipse.swt.layout.GridData;
3520+import org.eclipse.swt.layout.GridLayout;
3521+import org.eclipse.swt.widgets.Button;
3522+import org.eclipse.swt.widgets.Composite;
3523+import org.eclipse.swt.widgets.Event;
3524+import org.eclipse.swt.widgets.Group;
3525+import org.eclipse.swt.widgets.Label;
3526+import org.eclipse.swt.widgets.Link;
3527+import org.eclipse.swt.widgets.Listener;
3528+import org.eclipse.swt.widgets.Shell;
3529+import org.eclipse.swt.widgets.Text;
3530+import org.herac.tuxguitar.community.TGCommunitySingleton;
3531+import org.herac.tuxguitar.community.utils.TGCommunityWeb;
3532+import org.herac.tuxguitar.gui.TuxGuitar;
3533+import org.herac.tuxguitar.gui.util.DialogUtils;
3534+import org.herac.tuxguitar.util.TGSynchronizer;
3535+
3536+public class TGCommunityAuthDialog {
3537+
3538+ private boolean accepted;
3539+ private TGCommunityAuth auth;
3540+
3541+ public TGCommunityAuthDialog(){
3542+ this.auth = TGCommunitySingleton.getInstance().getAuth();
3543+ this.accepted = false;
3544+ }
3545+
3546+ public void open() {
3547+ this.open( TuxGuitar.instance().getShell() );
3548+ }
3549+
3550+ public void open(final Shell shell) {
3551+ try {
3552+ if( shell != null && !shell.isDisposed() ){
3553+ TGSynchronizer.instance().addRunnable(new TGSynchronizer.TGRunnable() {
3554+ public void run() throws Throwable {
3555+ if( !shell.isDisposed() ){
3556+ doOpen( shell );
3557+ }
3558+ }
3559+ });
3560+ }
3561+ }catch(Throwable throwable){
3562+ throwable.printStackTrace();
3563+ }
3564+ }
3565+
3566+ protected void doOpen(Shell shell) {
3567+ this.accepted = false;
3568+
3569+ final Shell dialog = DialogUtils.newDialog(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
3570+
3571+ dialog.setLayout(new GridLayout());
3572+ dialog.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
3573+ dialog.setImage(TuxGuitar.instance().getIconManager().getAppIcon());
3574+ dialog.setText(TuxGuitar.getProperty("tuxguitar-community.auth-dialog.title"));
3575+
3576+ Group group = new Group(dialog,SWT.SHADOW_ETCHED_IN);
3577+ group.setLayout(makeGroupLayout(2,5));
3578+ group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
3579+ group.setText(TuxGuitar.getProperty("tuxguitar-community.auth-dialog.signin"));
3580+
3581+ //-------USERNAME------------------------------------
3582+ Label usernameLabel = new Label(group, SWT.NULL);
3583+ usernameLabel.setLayoutData(makeLabelData());
3584+ usernameLabel.setText(TuxGuitar.getProperty("tuxguitar-community.auth-dialog.signin.username") + ":");
3585+
3586+ final Text usernameText = new Text(group, SWT.BORDER);
3587+ usernameText.setLayoutData(makeTextData());
3588+ usernameText.setText( this.auth.getUsername() );
3589+
3590+ //-------PASSWORD------------------------------------
3591+ Label passwordLabel = new Label(group, SWT.NULL);
3592+ passwordLabel.setLayoutData(makeLabelData());
3593+ passwordLabel.setText(TuxGuitar.getProperty("tuxguitar-community.auth-dialog.signin.password") + ":");
3594+
3595+ final Text passwordText = new Text(group, SWT.BORDER | SWT.PASSWORD );
3596+ passwordText.setLayoutData(makeTextData());
3597+ passwordText.setText( this.auth.getPassword() );
3598+
3599+ //-------JOIN------------------------------------
3600+ Group join = new Group(dialog,SWT.SHADOW_ETCHED_IN);
3601+ join.setLayout(makeGroupLayout(1,5));
3602+ //join.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
3603+ join.setLayoutData(new GridData(group.computeSize(SWT.DEFAULT, SWT.DEFAULT).x , SWT.DEFAULT));
3604+ join.setText(TuxGuitar.getProperty("tuxguitar-community.auth-dialog.signup"));
3605+
3606+ final Link joinLink = new Link( join, SWT.LEFT );
3607+ joinLink.setLayoutData( new GridData(SWT.LEFT, SWT.CENTER, true, true ));
3608+ joinLink.setText(TuxGuitar.getProperty("tuxguitar-community.auth-dialog.signup.tip"));
3609+ joinLink.addListener(SWT.Selection, new Listener() {
3610+ public void handleEvent(Event event) {
3611+ final String href = event.text;
3612+ if( href != null ){
3613+ new Thread( new Runnable() {
3614+ public void run() {
3615+ TGCommunityWeb.open( href );
3616+ }
3617+ } ).start();
3618+ }
3619+ }
3620+ });
3621+
3622+ //------------------BUTTONS--------------------------
3623+ Composite buttons = new Composite(dialog, SWT.NONE);
3624+ buttons.setLayout(new GridLayout(2,false));
3625+ buttons.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,true,true));
3626+
3627+ final Button buttonOK = new Button(buttons, SWT.PUSH);
3628+ buttonOK.setText(TuxGuitar.getProperty("ok"));
3629+ buttonOK.setLayoutData(getButtonData());
3630+ buttonOK.addSelectionListener(new SelectionAdapter() {
3631+ public void widgetSelected(SelectionEvent arg0) {
3632+ update(usernameText.getText(), passwordText.getText());
3633+
3634+ dialog.dispose();
3635+ }
3636+ });
3637+
3638+ Button buttonCancel = new Button(buttons, SWT.PUSH);
3639+ buttonCancel.setText(TuxGuitar.getProperty("cancel"));
3640+ buttonCancel.setLayoutData(getButtonData());
3641+ buttonCancel.addSelectionListener(new SelectionAdapter() {
3642+ public void widgetSelected(SelectionEvent arg0) {
3643+ dialog.dispose();
3644+ }
3645+ });
3646+
3647+ dialog.setDefaultButton( buttonOK );
3648+
3649+ DialogUtils.openDialog(dialog,DialogUtils.OPEN_STYLE_CENTER | DialogUtils.OPEN_STYLE_PACK | DialogUtils.OPEN_STYLE_WAIT);
3650+ }
3651+
3652+ private GridLayout makeGroupLayout(int columns, int spacing){
3653+ GridLayout layout = new GridLayout(columns,false);
3654+ layout.marginTop = spacing;
3655+ layout.marginBottom = spacing;
3656+ layout.marginLeft = spacing;
3657+ layout.marginRight = spacing;
3658+ layout.verticalSpacing = spacing;
3659+ layout.horizontalSpacing = spacing;
3660+ return layout;
3661+ }
3662+
3663+ private GridData makeLabelData(){
3664+ return new GridData(SWT.RIGHT,SWT.CENTER,false,true);
3665+ }
3666+
3667+ private GridData makeTextData(){
3668+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
3669+ data.minimumWidth = 250;
3670+ return data;
3671+ }
3672+
3673+ private GridData getButtonData(){
3674+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
3675+ data.minimumWidth = 80;
3676+ data.minimumHeight = 25;
3677+ return data;
3678+ }
3679+
3680+ protected void update( String username, String password){
3681+ this.auth.setUsername(username);
3682+ this.auth.setPassword(password);
3683+ this.accepted = true;
3684+ }
3685+
3686+ public boolean isAccepted(){
3687+ return this.accepted;
3688+ }
3689+}
3690
3691=== added directory 'TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils'
3692=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Decoder.java'
3693--- TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Decoder.java 1970-01-01 00:00:00 +0000
3694+++ TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Decoder.java 2010-05-21 18:17:28 +0000
3695@@ -0,0 +1,96 @@
3696+package org.herac.tuxguitar.community.auth.utils;
3697+
3698+import java.io.ByteArrayInputStream;
3699+import java.io.ByteArrayOutputStream;
3700+
3701+public class Base64Decoder {
3702+
3703+ private static final int BUFFER_SIZE = 1024;
3704+
3705+ private static int get1(byte buf[], int off) {
3706+ return ((buf[off] & 0x3f) << 2) | ((buf[off + 1] & 0x30) >>> 4);
3707+ }
3708+
3709+ private static int get2(byte buf[], int off) {
3710+ return ((buf[off + 1] & 0x0f) << 4) | ((buf[off + 2] & 0x3c) >>> 2);
3711+ }
3712+
3713+ private static int get3(byte buf[], int off) {
3714+ return ((buf[off + 2] & 0x03) << 6) | (buf[off + 3] & 0x3f);
3715+ }
3716+
3717+ private static int check(int ch) {
3718+ if ((ch >= 'A') && (ch <= 'Z')) {
3719+ return ch - 'A';
3720+ } else if ((ch >= 'a') && (ch <= 'z')) {
3721+ return ch - 'a' + 26;
3722+ } else if ((ch >= '0') && (ch <= '9')) {
3723+ return ch - '0' + 52;
3724+ } else {
3725+ switch (ch) {
3726+ case '=':
3727+ return 65;
3728+ case '+':
3729+ return 62;
3730+ case '/':
3731+ return 63;
3732+ default:
3733+ return -1;
3734+ }
3735+ }
3736+ }
3737+
3738+ public static byte[] decode(byte[] bytes){
3739+ try{
3740+ ByteArrayInputStream in = new ByteArrayInputStream( bytes );
3741+ ByteArrayOutputStream out = new ByteArrayOutputStream();
3742+
3743+ byte buffer[] = new byte[BUFFER_SIZE];
3744+ byte chunk[] = new byte[4];
3745+ int got = -1;
3746+ int ready = 0;
3747+
3748+ fill: while ((got = in.read(buffer)) > 0) {
3749+ int skiped = 0;
3750+
3751+ while (skiped < got) {
3752+
3753+ while (ready < 4) {
3754+ if (skiped >= got){
3755+ continue fill;
3756+ }
3757+ int ch = check(buffer[skiped++]);
3758+ if (ch >= 0) {
3759+ chunk[ready++] = (byte) ch;
3760+ }
3761+ }
3762+
3763+ if (chunk[2] == 65) {
3764+ out.write(get1(chunk, 0));
3765+ return out.toByteArray();
3766+ }
3767+ else if (chunk[3] == 65) {
3768+ out.write(get1(chunk, 0));
3769+ out.write(get2(chunk, 0));
3770+ return out.toByteArray();
3771+ }
3772+ else {
3773+ out.write(get1(chunk, 0));
3774+ out.write(get2(chunk, 0));
3775+ out.write(get3(chunk, 0));
3776+ }
3777+ ready = 0;
3778+ }
3779+ }
3780+ if (ready == 0){
3781+ out.flush();
3782+ return out.toByteArray();
3783+ }
3784+
3785+ }catch(Throwable throwable){
3786+ throwable.printStackTrace();
3787+ }
3788+
3789+ return bytes;
3790+ }
3791+}
3792\ No newline at end of file
3793
3794=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Encoder.java'
3795--- TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Encoder.java 1970-01-01 00:00:00 +0000
3796+++ TuxGuitar-community/src/org/herac/tuxguitar/community/auth/utils/Base64Encoder.java 2010-05-21 18:17:28 +0000
3797@@ -0,0 +1,132 @@
3798+package org.herac.tuxguitar.community.auth.utils;
3799+
3800+import java.io.ByteArrayInputStream;
3801+import java.io.ByteArrayOutputStream;
3802+
3803+public class Base64Encoder {
3804+
3805+ private static final int BUFFER_SIZE = 1024;
3806+
3807+ private static byte ENCODING[] = {
3808+ (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G', (byte) 'H',
3809+ (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N', (byte) 'O', (byte) 'P',
3810+ (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U', (byte) 'V', (byte) 'W', (byte) 'X',
3811+ (byte) 'Y', (byte) 'Z', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f',
3812+ (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j', (byte) 'k', (byte) 'l', (byte) 'm', (byte) 'n',
3813+ (byte) 'o', (byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't', (byte) 'u', (byte) 'v',
3814+ (byte) 'w', (byte) 'x', (byte) 'y', (byte) 'z', (byte) '0', (byte) '1', (byte) '2', (byte) '3',
3815+ (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) '+', (byte) '/',
3816+ (byte) '='
3817+ };
3818+
3819+ private static int get1(byte buf[], int off) {
3820+ return (buf[off] & 0xfc) >> 2;
3821+ }
3822+
3823+ private static int get2(byte buf[], int off) {
3824+ return ((buf[off] & 0x3) << 4) | ((buf[off + 1] & 0xf0) >>> 4);
3825+ }
3826+
3827+ private static int get3(byte buf[], int off) {
3828+ return ((buf[off + 1] & 0x0f) << 2) | ((buf[off + 2] & 0xc0) >>> 6);
3829+ }
3830+
3831+ private static int get4(byte buf[], int off) {
3832+ return buf[off + 2] & 0x3f;
3833+ }
3834+
3835+ public static byte[] encode(byte[] bytes) {
3836+ try{
3837+
3838+ ByteArrayInputStream in = new ByteArrayInputStream( bytes );
3839+ ByteArrayOutputStream out = new ByteArrayOutputStream();
3840+
3841+ byte buffer[] = new byte[BUFFER_SIZE];
3842+ int got = -1;
3843+ int off = 0;
3844+ int count = 0;
3845+ while ((got = in.read(buffer, off, BUFFER_SIZE - off)) > 0) {
3846+ if ((got + off) >= 3) {
3847+ got += off;
3848+ off = 0;
3849+ while (off + 3 <= got) {
3850+ int c1 = get1(buffer, off);
3851+ int c2 = get2(buffer, off);
3852+ int c3 = get3(buffer, off);
3853+ int c4 = get4(buffer, off);
3854+ switch (count) {
3855+ case 73:
3856+ out.write(ENCODING[c1]);
3857+ out.write(ENCODING[c2]);
3858+ out.write(ENCODING[c3]);
3859+ out.write('\n');
3860+ out.write(ENCODING[c4]);
3861+ count = 1;
3862+ break;
3863+ case 74:
3864+ out.write(ENCODING[c1]);
3865+ out.write(ENCODING[c2]);
3866+ out.write('\n');
3867+ out.write(ENCODING[c3]);
3868+ out.write(ENCODING[c4]);
3869+ count = 2;
3870+ break;
3871+ case 75:
3872+ out.write(ENCODING[c1]);
3873+ out.write('\n');
3874+ out.write(ENCODING[c2]);
3875+ out.write(ENCODING[c3]);
3876+ out.write(ENCODING[c4]);
3877+ count = 3;
3878+ break;
3879+ case 76:
3880+ out.write('\n');
3881+ out.write(ENCODING[c1]);
3882+ out.write(ENCODING[c2]);
3883+ out.write(ENCODING[c3]);
3884+ out.write(ENCODING[c4]);
3885+ count = 4;
3886+ break;
3887+ default:
3888+ out.write(ENCODING[c1]);
3889+ out.write(ENCODING[c2]);
3890+ out.write(ENCODING[c3]);
3891+ out.write(ENCODING[c4]);
3892+ count += 4;
3893+ break;
3894+ }
3895+ off += 3;
3896+ }
3897+
3898+ for (int i = 0; i < 3; i++){
3899+ buffer[i] = (i < got - off) ? buffer[off + i] : ((byte) 0);
3900+ }
3901+ off = got - off;
3902+ } else {
3903+ off += got;
3904+ }
3905+ }
3906+
3907+ switch (off) {
3908+ case 1:
3909+ out.write(ENCODING[get1(buffer, 0)]);
3910+ out.write(ENCODING[get2(buffer, 0)]);
3911+ out.write('=');
3912+ out.write('=');
3913+ break;
3914+ case 2:
3915+ out.write(ENCODING[get1(buffer, 0)]);
3916+ out.write(ENCODING[get2(buffer, 0)]);
3917+ out.write(ENCODING[get3(buffer, 0)]);
3918+ out.write('=');
3919+ }
3920+
3921+ return out.toByteArray();
3922+
3923+ }catch(Throwable throwable){
3924+ throwable.printStackTrace();
3925+ }
3926+
3927+ return bytes;
3928+ }
3929+}
3930\ No newline at end of file
3931
3932=== added directory 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser'
3933=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserAuthDialog.java'
3934--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserAuthDialog.java 1970-01-01 00:00:00 +0000
3935+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserAuthDialog.java 2010-05-21 18:17:28 +0000
3936@@ -0,0 +1,128 @@
3937+package org.herac.tuxguitar.community.browser;
3938+
3939+import org.eclipse.swt.SWT;
3940+import org.eclipse.swt.events.SelectionAdapter;
3941+import org.eclipse.swt.events.SelectionEvent;
3942+import org.eclipse.swt.layout.GridData;
3943+import org.eclipse.swt.layout.GridLayout;
3944+import org.eclipse.swt.widgets.Button;
3945+import org.eclipse.swt.widgets.Composite;
3946+import org.eclipse.swt.widgets.Group;
3947+import org.eclipse.swt.widgets.Label;
3948+import org.eclipse.swt.widgets.Shell;
3949+import org.eclipse.swt.widgets.Text;
3950+import org.herac.tuxguitar.community.TGCommunitySingleton;
3951+import org.herac.tuxguitar.community.auth.TGCommunityAuthDialog;
3952+import org.herac.tuxguitar.gui.TuxGuitar;
3953+import org.herac.tuxguitar.gui.util.DialogUtils;
3954+
3955+public class TGBrowserAuthDialog {
3956+
3957+ private boolean accepted;
3958+
3959+ public TGBrowserAuthDialog(){
3960+ this.accepted = false;
3961+ }
3962+
3963+ protected void open(Shell shell) {
3964+ this.accepted = false;
3965+
3966+ final Shell dialog = DialogUtils.newDialog(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
3967+
3968+ dialog.setLayout(new GridLayout());
3969+ dialog.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
3970+ dialog.setImage(TuxGuitar.instance().getIconManager().getAppIcon());
3971+ dialog.setText(TuxGuitar.getProperty("tuxguitar-community.browser-dialog.title"));
3972+
3973+ Group group = new Group(dialog,SWT.SHADOW_ETCHED_IN);
3974+ group.setLayout(makeGroupLayout(5));
3975+ group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
3976+ group.setText(TuxGuitar.getProperty("tuxguitar-community.browser-dialog.account"));
3977+
3978+ //-------USERNAME---------------------------------
3979+ Label usernameLabel = new Label(group, SWT.NULL);
3980+ usernameLabel.setLayoutData(makeLabelData());
3981+ usernameLabel.setText(TuxGuitar.getProperty("tuxguitar-community.browser-dialog.account.user") + ":");
3982+
3983+ final Text usernameText = new Text(group, SWT.BORDER | SWT.READ_ONLY );
3984+ usernameText.setLayoutData(makeUsernameTextData());
3985+ usernameText.setText( TGCommunitySingleton.getInstance().getAuth().getUsername() );
3986+
3987+ final Button usernameChooser = new Button(group, SWT.PUSH );
3988+ usernameChooser.setText("...");
3989+ usernameChooser.addSelectionListener( new SelectionAdapter() {
3990+ public void widgetSelected(SelectionEvent e) {
3991+ TGCommunityAuthDialog authDialog = new TGCommunityAuthDialog();
3992+ authDialog.open( dialog );
3993+ if( authDialog.isAccepted() ){
3994+ TGCommunitySingleton.getInstance().getAuth().update();
3995+ usernameText.setText( TGCommunitySingleton.getInstance().getAuth().getUsername() );
3996+ }
3997+ }
3998+ } );
3999+
4000+ //------------------BUTTONS--------------------------
4001+ Composite buttons = new Composite(dialog, SWT.NONE);
4002+ buttons.setLayout(new GridLayout(2,false));
4003+ buttons.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,true,true));
4004+
4005+ final Button buttonOK = new Button(buttons, SWT.PUSH);
4006+ buttonOK.setText(TuxGuitar.getProperty("ok"));
4007+ buttonOK.setLayoutData(getButtonData());
4008+ buttonOK.addSelectionListener(new SelectionAdapter() {
4009+ public void widgetSelected(SelectionEvent arg0) {
4010+ setAccepted();
4011+ dialog.dispose();
4012+ }
4013+ });
4014+
4015+ Button buttonCancel = new Button(buttons, SWT.PUSH);
4016+ buttonCancel.setText(TuxGuitar.getProperty("cancel"));
4017+ buttonCancel.setLayoutData(getButtonData());
4018+ buttonCancel.addSelectionListener(new SelectionAdapter() {
4019+ public void widgetSelected(SelectionEvent arg0) {
4020+ dialog.dispose();
4021+ }
4022+ });
4023+
4024+ dialog.setDefaultButton( buttonOK );
4025+
4026+ DialogUtils.openDialog(dialog,DialogUtils.OPEN_STYLE_CENTER | DialogUtils.OPEN_STYLE_PACK | DialogUtils.OPEN_STYLE_WAIT);
4027+ }
4028+
4029+ private GridLayout makeGroupLayout(int spacing){
4030+ GridLayout layout = new GridLayout(3,false);
4031+ layout.marginTop = spacing;
4032+ layout.marginBottom = spacing;
4033+ layout.marginLeft = spacing;
4034+ layout.marginRight = spacing;
4035+ layout.verticalSpacing = spacing;
4036+ layout.horizontalSpacing = spacing;
4037+ return layout;
4038+ }
4039+
4040+ private GridData makeLabelData(){
4041+ return new GridData(SWT.RIGHT,SWT.CENTER,false,true);
4042+ }
4043+
4044+ private GridData makeUsernameTextData(){
4045+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
4046+ data.minimumWidth = 250;
4047+ return data;
4048+ }
4049+
4050+ private GridData getButtonData(){
4051+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
4052+ data.minimumWidth = 80;
4053+ data.minimumHeight = 25;
4054+ return data;
4055+ }
4056+
4057+ protected void setAccepted(){
4058+ this.accepted = true;
4059+ }
4060+
4061+ public boolean isAccepted(){
4062+ return this.accepted;
4063+ }
4064+}
4065
4066=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserConnection.java'
4067--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserConnection.java 1970-01-01 00:00:00 +0000
4068+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserConnection.java 2010-05-21 18:17:28 +0000
4069@@ -0,0 +1,45 @@
4070+package org.herac.tuxguitar.community.browser;
4071+
4072+import java.util.List;
4073+
4074+import org.herac.tuxguitar.community.TGCommunitySingleton;
4075+import org.herac.tuxguitar.community.auth.TGCommunityAuth;
4076+import org.herac.tuxguitar.community.auth.TGCommunityAuthDialog;
4077+import org.herac.tuxguitar.gui.TuxGuitar;
4078+import org.herac.tuxguitar.gui.tools.browser.TGBrowserException;
4079+
4080+public class TGBrowserConnection {
4081+
4082+ private static final String HTTP_STATUS_OK = "200";
4083+ private static final String HTTP_STATUS_UNAUTHORIZED = "401";
4084+
4085+ private TGCommunityAuth auth;
4086+
4087+ public TGBrowserConnection(){
4088+ this.auth = TGCommunitySingleton.getInstance().getAuth();
4089+ this.auth.update();
4090+ }
4091+
4092+ public void getElements( List elements, TGBrowserElementImpl element ) throws TGBrowserException{
4093+ try {
4094+ TGBrowserRequest request = new TGBrowserRequest(this.auth, element);
4095+ TGBrowserResponse response = request.getResponse();
4096+
4097+ String status = response.getStatus();
4098+ if( status != null && status.equals(HTTP_STATUS_OK) ){
4099+ response.loadElements( elements );
4100+ }else if( status != null && status.equals(HTTP_STATUS_UNAUTHORIZED) ){
4101+ TGCommunityAuthDialog authDialog = new TGCommunityAuthDialog();
4102+ if( !TuxGuitar.instance().getBrowser().isDisposed() ){
4103+ authDialog.open( TuxGuitar.instance().getBrowser().getShell() );
4104+ if( authDialog.isAccepted() ){
4105+ this.auth.update();
4106+ this.getElements(elements, element );
4107+ }
4108+ }
4109+ }
4110+ }catch(Throwable throwable){
4111+ throw new TGBrowserException(throwable);
4112+ }
4113+ }
4114+}
4115
4116=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserDataImpl.java'
4117--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserDataImpl.java 1970-01-01 00:00:00 +0000
4118+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserDataImpl.java 2010-05-21 18:17:28 +0000
4119@@ -0,0 +1,18 @@
4120+package org.herac.tuxguitar.community.browser;
4121+
4122+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserData;
4123+
4124+public class TGBrowserDataImpl implements TGBrowserData {
4125+
4126+ public TGBrowserDataImpl(){
4127+ super();
4128+ }
4129+
4130+ public String getTitle() {
4131+ return "TuxGuitar Community";
4132+ }
4133+
4134+ public String toString(){
4135+ return getTitle();
4136+ }
4137+}
4138
4139=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserElementImpl.java'
4140--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserElementImpl.java 1970-01-01 00:00:00 +0000
4141+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserElementImpl.java 2010-05-21 18:17:28 +0000
4142@@ -0,0 +1,69 @@
4143+package org.herac.tuxguitar.community.browser;
4144+
4145+import java.io.InputStream;
4146+import java.net.URL;
4147+import java.util.HashMap;
4148+import java.util.Iterator;
4149+import java.util.Map;
4150+
4151+import org.herac.tuxguitar.gui.tools.browser.TGBrowserException;
4152+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserElement;
4153+
4154+public class TGBrowserElementImpl extends TGBrowserElement {
4155+
4156+ private TGBrowserElementImpl parent;
4157+ private Map properties;
4158+ private String url;
4159+
4160+ public TGBrowserElementImpl(String name) {
4161+ super(name);
4162+ this.url = null;
4163+ this.properties = new HashMap();
4164+ }
4165+
4166+ public TGBrowserElementImpl getParent() {
4167+ return this.parent;
4168+ }
4169+
4170+ public void setParent(TGBrowserElementImpl parent) {
4171+ this.parent = parent;
4172+ }
4173+
4174+ public String getUrl() {
4175+ return this.url;
4176+ }
4177+
4178+ public void setUrl(String url) {
4179+ this.url = url;
4180+ }
4181+
4182+ public void addProperty( String key, String value ){
4183+ this.properties.put( key, value );
4184+ }
4185+
4186+ public String getProperty( String key ){
4187+ return (String)this.properties.get( key );
4188+ }
4189+
4190+ public Iterator getProperties(){
4191+ return this.properties.entrySet().iterator();
4192+ }
4193+
4194+ public boolean isFolder() {
4195+ return (this.url == null || this.url.length() == 0 );
4196+ }
4197+
4198+ public InputStream getInputStream() throws TGBrowserException {
4199+ try {
4200+ if( ! this.isFolder() ){
4201+ URL url = new URL( this.url );
4202+ InputStream stream = url.openStream();
4203+
4204+ return stream;
4205+ }
4206+ } catch ( Throwable throwable ){
4207+ throw new TGBrowserException( throwable );
4208+ }
4209+ return null;
4210+ }
4211+}
4212
4213=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserFactoryImpl.java'
4214--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserFactoryImpl.java 1970-01-01 00:00:00 +0000
4215+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserFactoryImpl.java 2010-05-21 18:17:28 +0000
4216@@ -0,0 +1,41 @@
4217+package org.herac.tuxguitar.community.browser;
4218+
4219+import org.eclipse.swt.widgets.Shell;
4220+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowser;
4221+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserData;
4222+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserFactory;
4223+
4224+public class TGBrowserFactoryImpl implements TGBrowserFactory {
4225+
4226+ private TGBrowserDataImpl data;
4227+
4228+ public TGBrowserFactoryImpl(){
4229+ this.data = new TGBrowserDataImpl();
4230+ }
4231+
4232+ public String getName() {
4233+ return "Community Files";
4234+ }
4235+
4236+ public String getType() {
4237+ return "community";
4238+ }
4239+
4240+ public TGBrowser newTGBrowser(TGBrowserData data) {
4241+ return new TGBrowserImpl( (TGBrowserDataImpl)data );
4242+ }
4243+
4244+ public TGBrowserData parseData(String string) {
4245+ return this.data;
4246+ }
4247+
4248+ public TGBrowserData dataDialog(Shell parent) {
4249+ TGBrowserAuthDialog authDialog = new TGBrowserAuthDialog();
4250+ authDialog.open( parent );
4251+ if( authDialog.isAccepted() ){
4252+ return this.data;
4253+ }
4254+ return null;
4255+ }
4256+
4257+}
4258
4259=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserImpl.java'
4260--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserImpl.java 1970-01-01 00:00:00 +0000
4261+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserImpl.java 2010-05-21 18:17:28 +0000
4262@@ -0,0 +1,51 @@
4263+package org.herac.tuxguitar.community.browser;
4264+
4265+import java.util.ArrayList;
4266+import java.util.List;
4267+
4268+import org.herac.tuxguitar.gui.tools.browser.TGBrowserException;
4269+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowser;
4270+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserElement;
4271+
4272+public class TGBrowserImpl extends TGBrowser {
4273+
4274+ private TGBrowserConnection connection;
4275+ private TGBrowserElementImpl element;
4276+
4277+ public TGBrowserImpl(TGBrowserDataImpl data){
4278+ this.element = null;
4279+ this.connection = new TGBrowserConnection();
4280+ }
4281+
4282+ public void open() throws TGBrowserException {
4283+ // TODO Auto-generated method stub
4284+ }
4285+
4286+ public void close() throws TGBrowserException {
4287+ // TODO Auto-generated method stub
4288+ }
4289+
4290+ public void cdRoot() throws TGBrowserException {
4291+ this.element = null;
4292+ }
4293+
4294+ public void cdUp() throws TGBrowserException {
4295+ if( this.element != null ){
4296+ this.element = this.element.getParent();
4297+ }
4298+ }
4299+
4300+ public void cdElement(TGBrowserElement element) throws TGBrowserException {
4301+ if( element instanceof TGBrowserElementImpl ){
4302+ TGBrowserElementImpl nextElement = (TGBrowserElementImpl)element;
4303+ nextElement.setParent( this.element );
4304+ this.element = nextElement;
4305+ }
4306+ }
4307+
4308+ public List listElements() throws TGBrowserException {
4309+ List elements = new ArrayList();
4310+ this.connection.getElements(elements , this.element );
4311+ return elements;
4312+ }
4313+}
4314
4315=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserPluginImpl.java'
4316--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserPluginImpl.java 1970-01-01 00:00:00 +0000
4317+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserPluginImpl.java 2010-05-21 18:17:28 +0000
4318@@ -0,0 +1,13 @@
4319+package org.herac.tuxguitar.community.browser;
4320+
4321+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
4322+import org.herac.tuxguitar.gui.system.plugins.base.TGBrowserPlugin;
4323+import org.herac.tuxguitar.gui.tools.browser.base.TGBrowserFactory;
4324+
4325+public class TGBrowserPluginImpl extends TGBrowserPlugin {
4326+
4327+ protected TGBrowserFactory getFactory() throws TGPluginException {
4328+ return new TGBrowserFactoryImpl();
4329+ }
4330+
4331+}
4332
4333=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserRequest.java'
4334--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserRequest.java 1970-01-01 00:00:00 +0000
4335+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserRequest.java 2010-05-21 18:17:28 +0000
4336@@ -0,0 +1,57 @@
4337+package org.herac.tuxguitar.community.browser;
4338+
4339+import java.io.OutputStreamWriter;
4340+import java.net.URL;
4341+import java.net.URLConnection;
4342+import java.net.URLEncoder;
4343+import java.util.Iterator;
4344+import java.util.Map;
4345+
4346+import org.herac.tuxguitar.community.auth.TGCommunityAuth;
4347+import org.herac.tuxguitar.community.utils.TGCommunityWeb;
4348+
4349+public class TGBrowserRequest {
4350+
4351+ private static final String REMOTE_URL = (TGCommunityWeb.HOME_URL + "/rd.php/sharing/tuxguitar/browser.do");
4352+
4353+ private String request;
4354+
4355+ public TGBrowserRequest(TGCommunityAuth auth, TGBrowserElementImpl element) throws Throwable {
4356+ this.initialize(auth, element);
4357+ }
4358+
4359+ public TGBrowserRequest(TGCommunityAuth auth) throws Throwable {
4360+ this(auth , null);
4361+ }
4362+
4363+ private void initialize( TGCommunityAuth auth, TGBrowserElementImpl element ) throws Throwable {
4364+ this.request = new String();
4365+ this.request += URLEncoder.encode( "auth" , "UTF-8" );
4366+ this.request += ("=");
4367+ this.request += URLEncoder.encode( auth.getAuthCode() , "UTF-8" );
4368+
4369+ if( element != null ){
4370+ Iterator it = element.getProperties();
4371+ while( it.hasNext() ){
4372+ Map.Entry property = (Map.Entry) it.next();
4373+ this.request += ("&");
4374+ this.request += URLEncoder.encode( (String)property.getKey() , "UTF-8" );
4375+ this.request += ("=");
4376+ this.request += URLEncoder.encode( (String)property.getValue() , "UTF-8" );
4377+ }
4378+ }
4379+ }
4380+
4381+ public TGBrowserResponse getResponse() throws Throwable {
4382+ URL url = new URL(REMOTE_URL);
4383+ URLConnection conn = url.openConnection();
4384+ conn.setDoOutput(true);
4385+
4386+ OutputStreamWriter outputStream = new OutputStreamWriter(conn.getOutputStream());
4387+ outputStream.write(this.request);
4388+ outputStream.flush();
4389+ outputStream.close();
4390+
4391+ return new TGBrowserResponse( conn.getInputStream() ) ;
4392+ }
4393+}
4394
4395=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserResponse.java'
4396--- TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserResponse.java 1970-01-01 00:00:00 +0000
4397+++ TuxGuitar-community/src/org/herac/tuxguitar/community/browser/TGBrowserResponse.java 2010-05-21 18:17:28 +0000
4398@@ -0,0 +1,130 @@
4399+package org.herac.tuxguitar.community.browser;
4400+
4401+import java.io.InputStream;
4402+import java.net.URLDecoder;
4403+import java.util.List;
4404+
4405+import javax.xml.parsers.DocumentBuilder;
4406+import javax.xml.parsers.DocumentBuilderFactory;
4407+
4408+import org.w3c.dom.Document;
4409+import org.w3c.dom.NamedNodeMap;
4410+import org.w3c.dom.Node;
4411+import org.w3c.dom.NodeList;
4412+
4413+public class TGBrowserResponse {
4414+
4415+ private static final String TAG_STATUS = "status";
4416+ private static final String TAG_ELEMENTS = "elements";
4417+ private static final String TAG_ELEMENT = "element";
4418+ private static final String TAG_SONG = "song";
4419+ private static final String TAG_PARAMETERS = "parameters";
4420+ private static final String TAG_PARAMETER = "parameter";
4421+ private static final String ATTRIBUTE_CODE = "code";
4422+ private static final String ATTRIBUTE_NAME = "name";
4423+ private static final String ATTRIBUTE_URL = "url";
4424+ private static final String ATTRIBUTE_KEY = "key";
4425+ private static final String ATTRIBUTE_VALUE = "value";
4426+
4427+ private Document document;
4428+
4429+ public TGBrowserResponse( InputStream stream ) throws Throwable {
4430+ this.initialize( stream );
4431+ }
4432+
4433+ private void initialize(InputStream stream) throws Throwable {
4434+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
4435+ DocumentBuilder builder = factory.newDocumentBuilder();
4436+ this.document = builder.parse(stream);
4437+ }
4438+
4439+ public String getStatus() {
4440+ if ( this.document != null ){
4441+ return getStatus(this.document.getFirstChild());
4442+ }
4443+ return null;
4444+ }
4445+
4446+ private String getStatus(Node rootNode){
4447+ NodeList rootNodes = rootNode.getChildNodes();
4448+ for (int i = 0; i < rootNodes.getLength(); i++) {
4449+ Node statusNode = rootNodes.item(i);
4450+ if (statusNode.getNodeName().equals( TAG_STATUS )) {
4451+ return getAttributeValue( statusNode.getAttributes(), ATTRIBUTE_CODE);
4452+ }
4453+ }
4454+ return null;
4455+ }
4456+
4457+ public void loadElements(List list){
4458+ if ( this.document != null ){
4459+ loadElements(list,this.document.getFirstChild());
4460+ }
4461+ }
4462+
4463+ private void loadElements(List list,Node rootNode){
4464+ NodeList rootNodes = rootNode.getChildNodes();
4465+ for (int i = 0; i < rootNodes.getLength(); i++) {
4466+ Node elementsNode = rootNodes.item(i);
4467+
4468+ if (elementsNode.getNodeName().equals( TAG_ELEMENTS )) {
4469+
4470+ NodeList elementList = elementsNode.getChildNodes();
4471+ for (int e = 0; e < elementList.getLength(); e++) {
4472+ Node elementNode = elementList.item(e);
4473+ String nodeName = elementNode.getNodeName();
4474+
4475+ if (nodeName.equals( TAG_ELEMENT )) {
4476+ NamedNodeMap params = elementNode.getAttributes();
4477+
4478+ String name = getAttributeValue( params, ATTRIBUTE_NAME);
4479+ if (name != null && name.trim().length() > 0 ){
4480+ TGBrowserElementImpl element = new TGBrowserElementImpl( name );
4481+
4482+ NodeList nodeChildren = elementNode.getChildNodes();
4483+ for (int c = 0; c < nodeChildren.getLength(); c++) {
4484+ Node child = nodeChildren.item( c );
4485+ if( child.getNodeName().equals( TAG_SONG ) ){
4486+ element.setUrl( getAttributeValue( child.getAttributes() , ATTRIBUTE_URL) );
4487+ }else if( child.getNodeName().equals( TAG_PARAMETERS ) ){
4488+
4489+ NodeList parameters = child.getChildNodes();
4490+ for (int p = 0; p < parameters.getLength(); p++) {
4491+
4492+ Node parameter = parameters.item( p );
4493+ if( parameter.getNodeName().equals( TAG_PARAMETER ) ){
4494+ NamedNodeMap parameterAttributes = parameter.getAttributes();
4495+
4496+ String key = getAttributeValue( parameterAttributes, ATTRIBUTE_KEY);
4497+ String value = getAttributeValue( parameterAttributes, ATTRIBUTE_VALUE);
4498+
4499+ if (key != null && value != null && key.trim().length() > 0 && value.trim().length() > 0 ){
4500+ element.addProperty(key, value);
4501+ }
4502+ }
4503+ }
4504+ }
4505+ }
4506+
4507+ list.add( element );
4508+ }
4509+ }
4510+ }
4511+ }
4512+ }
4513+ }
4514+
4515+ private String getAttributeValue( NamedNodeMap node , String attribute ){
4516+ try{
4517+ if( node != null && attribute != null ){
4518+ Node namedItem = node.getNamedItem( attribute );
4519+ if( namedItem != null ){
4520+ return URLDecoder.decode(namedItem.getNodeValue(), "UTF-8");
4521+ }
4522+ }
4523+ } catch ( Throwable throwable ){
4524+ throwable.printStackTrace();
4525+ }
4526+ return null;
4527+ }
4528+}
4529
4530=== added directory 'TuxGuitar-community/src/org/herac/tuxguitar/community/io'
4531=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFile.java'
4532--- TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFile.java 1970-01-01 00:00:00 +0000
4533+++ TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFile.java 2010-05-21 18:17:28 +0000
4534@@ -0,0 +1,51 @@
4535+package org.herac.tuxguitar.community.io;
4536+
4537+public class TGShareFile {
4538+
4539+ private byte[] file;
4540+ private String title;
4541+ private String description;
4542+ private String tagkeys;
4543+
4544+ public TGShareFile(){
4545+ this.title = new String();
4546+ this.description = new String();
4547+ this.tagkeys = new String();
4548+ }
4549+
4550+ public byte[] getFile() {
4551+ return this.file;
4552+ }
4553+
4554+ public void setFile(byte[] file) {
4555+ this.file = file;
4556+ }
4557+
4558+ public String getTitle() {
4559+ return this.title;
4560+ }
4561+
4562+ public void setTitle(String title) {
4563+ this.title = title;
4564+ }
4565+
4566+ public String getDescription() {
4567+ return this.description;
4568+ }
4569+
4570+ public void setDescription(String description) {
4571+ this.description = description;
4572+ }
4573+
4574+ public String getTagkeys() {
4575+ return this.tagkeys;
4576+ }
4577+
4578+ public void setTagkeys(String tagkeys) {
4579+ this.tagkeys = tagkeys;
4580+ }
4581+
4582+ public String getFilename(){
4583+ return ( this.title + ".tg" );
4584+ }
4585+}
4586
4587=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFileDialog.java'
4588--- TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFileDialog.java 1970-01-01 00:00:00 +0000
4589+++ TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareFileDialog.java 2010-05-21 18:17:28 +0000
4590@@ -0,0 +1,195 @@
4591+package org.herac.tuxguitar.community.io;
4592+
4593+import org.eclipse.swt.SWT;
4594+import org.eclipse.swt.events.SelectionAdapter;
4595+import org.eclipse.swt.events.SelectionEvent;
4596+import org.eclipse.swt.layout.GridData;
4597+import org.eclipse.swt.layout.GridLayout;
4598+import org.eclipse.swt.widgets.Button;
4599+import org.eclipse.swt.widgets.Composite;
4600+import org.eclipse.swt.widgets.Group;
4601+import org.eclipse.swt.widgets.Label;
4602+import org.eclipse.swt.widgets.Shell;
4603+import org.eclipse.swt.widgets.Text;
4604+import org.herac.tuxguitar.community.TGCommunitySingleton;
4605+import org.herac.tuxguitar.community.auth.TGCommunityAuthDialog;
4606+import org.herac.tuxguitar.gui.TuxGuitar;
4607+import org.herac.tuxguitar.gui.util.DialogUtils;
4608+import org.herac.tuxguitar.gui.util.MessageDialog;
4609+import org.herac.tuxguitar.util.TGSynchronizer;
4610+
4611+public class TGShareFileDialog {
4612+
4613+ private boolean accepted;
4614+ private TGShareFile file;
4615+ private String errors;
4616+
4617+ public TGShareFileDialog(TGShareFile file , String errors ){
4618+ this.file = file;
4619+ this.errors = errors;
4620+ this.accepted = false;
4621+ }
4622+
4623+ public void open() {
4624+ try {
4625+ TGSynchronizer.instance().addRunnable(new TGSynchronizer.TGRunnable() {
4626+ public void run() throws Throwable {
4627+ if( !TuxGuitar.isDisposed() ){
4628+ open( TuxGuitar.instance().getShell() );
4629+ }
4630+ }
4631+ });
4632+ }catch(Throwable throwable){
4633+ throwable.printStackTrace();
4634+ }
4635+ }
4636+
4637+ protected void open(Shell shell) {
4638+ this.accepted = false;
4639+
4640+ final Shell dialog = DialogUtils.newDialog(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
4641+
4642+ dialog.setLayout(new GridLayout());
4643+ dialog.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
4644+ dialog.setImage(TuxGuitar.instance().getIconManager().getAppIcon());
4645+ dialog.setText(TuxGuitar.getProperty("tuxguitar-community.share-dialog.title"));
4646+
4647+ Group group = new Group(dialog,SWT.SHADOW_ETCHED_IN);
4648+ group.setLayout(makeGroupLayout(5));
4649+ group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
4650+ group.setText(TuxGuitar.getProperty("tuxguitar-community.share-dialog.details"));
4651+
4652+ //-------USERNAME---------------------------------
4653+ Label usernameLabel = new Label(group, SWT.NULL);
4654+ usernameLabel.setLayoutData(makeLabelData());
4655+ usernameLabel.setText(TuxGuitar.getProperty("tuxguitar-community.share-dialog.details.user") + ":");
4656+
4657+ final Text usernameText = new Text(group, SWT.BORDER | SWT.READ_ONLY );
4658+ usernameText.setLayoutData(makeUsernameTextData());
4659+ usernameText.setText( TGCommunitySingleton.getInstance().getAuth().getUsername() );
4660+
4661+ final Button usernameChooser = new Button(group, SWT.PUSH );
4662+ usernameChooser.setText("...");
4663+ usernameChooser.addSelectionListener( new SelectionAdapter() {
4664+ public void widgetSelected(SelectionEvent e) {
4665+ TGCommunityAuthDialog authDialog = new TGCommunityAuthDialog();
4666+ authDialog.open( dialog );
4667+ if( authDialog.isAccepted() ){
4668+ TGCommunitySingleton.getInstance().getAuth().update();
4669+ usernameText.setText( TGCommunitySingleton.getInstance().getAuth().getUsername() );
4670+ }
4671+ }
4672+ } );
4673+
4674+ //-------TITLE------------------------------------
4675+ Label titleLabel = new Label(group, SWT.NULL);
4676+ titleLabel.setLayoutData(makeLabelData());
4677+ titleLabel.setText(TuxGuitar.getProperty("tuxguitar-community.share-dialog.details.title") + ":");
4678+
4679+ final Text titleText = new Text(group, SWT.BORDER);
4680+ titleText.setLayoutData(makeTextData());
4681+ titleText.setText( this.file.getTitle() );
4682+
4683+ //-------TAGKEYS------------------------------------
4684+ Label tagkeysLabel = new Label(group, SWT.NULL);
4685+ tagkeysLabel.setLayoutData(makeLabelData());
4686+ tagkeysLabel.setText(TuxGuitar.getProperty("tuxguitar-community.share-dialog.details.tagkeys") + ":");
4687+
4688+ final Text tagkeysText = new Text(group, SWT.BORDER);
4689+ tagkeysText.setLayoutData(makeTextData());
4690+ tagkeysText.setText( this.file.getTagkeys() );
4691+
4692+ //-------DESCRIPTION------------------------------------
4693+ Label descriptionLabel = new Label(group, SWT.NULL);
4694+ descriptionLabel.setLayoutData(makeLabelData());
4695+ descriptionLabel.setText(TuxGuitar.getProperty("tuxguitar-community.share-dialog.details.description") + ":");
4696+
4697+ final Text descriptionText = new Text(group, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
4698+ descriptionText.setLayoutData(makeTextAreaData());
4699+ descriptionText.setText( this.file.getDescription() );
4700+
4701+ //------------------BUTTONS--------------------------
4702+ Composite buttons = new Composite(dialog, SWT.NONE);
4703+ buttons.setLayout(new GridLayout(2,false));
4704+ buttons.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,true,true));
4705+
4706+ final Button buttonOK = new Button(buttons, SWT.PUSH);
4707+ buttonOK.setText(TuxGuitar.getProperty("ok"));
4708+ buttonOK.setLayoutData(getButtonData());
4709+ buttonOK.addSelectionListener(new SelectionAdapter() {
4710+ public void widgetSelected(SelectionEvent arg0) {
4711+ update(titleText.getText(), tagkeysText.getText() , descriptionText.getText() );
4712+
4713+ dialog.dispose();
4714+ }
4715+ });
4716+
4717+ Button buttonCancel = new Button(buttons, SWT.PUSH);
4718+ buttonCancel.setText(TuxGuitar.getProperty("cancel"));
4719+ buttonCancel.setLayoutData(getButtonData());
4720+ buttonCancel.addSelectionListener(new SelectionAdapter() {
4721+ public void widgetSelected(SelectionEvent arg0) {
4722+ dialog.dispose();
4723+ }
4724+ });
4725+
4726+ dialog.setDefaultButton( buttonOK );
4727+
4728+ if( this.errors != null ){
4729+ MessageDialog.errorMessage(dialog, this.errors);
4730+ }
4731+ DialogUtils.openDialog(dialog,DialogUtils.OPEN_STYLE_CENTER | DialogUtils.OPEN_STYLE_PACK | DialogUtils.OPEN_STYLE_WAIT);
4732+ }
4733+
4734+ private GridLayout makeGroupLayout(int spacing){
4735+ GridLayout layout = new GridLayout(3,false);
4736+ layout.marginTop = spacing;
4737+ layout.marginBottom = spacing;
4738+ layout.marginLeft = spacing;
4739+ layout.marginRight = spacing;
4740+ layout.verticalSpacing = spacing;
4741+ layout.horizontalSpacing = spacing;
4742+ return layout;
4743+ }
4744+
4745+ private GridData makeLabelData(){
4746+ return new GridData(SWT.RIGHT,SWT.CENTER,false,true);
4747+ }
4748+
4749+ private GridData makeTextAreaData(){
4750+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 2 , 1);
4751+ data.minimumWidth = 250;
4752+ data.minimumHeight = 100;
4753+ return data;
4754+ }
4755+
4756+ private GridData makeTextData(){
4757+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 2 , 1);
4758+ data.minimumWidth = 250;
4759+ return data;
4760+ }
4761+
4762+ private GridData makeUsernameTextData(){
4763+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
4764+ data.minimumWidth = 250;
4765+ return data;
4766+ }
4767+
4768+ private GridData getButtonData(){
4769+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
4770+ data.minimumWidth = 80;
4771+ data.minimumHeight = 25;
4772+ return data;
4773+ }
4774+
4775+ protected void update( String title, String tagkeys, String description ){
4776+ this.file.setTitle( title );
4777+ this.file.setTagkeys( tagkeys );
4778+ this.file.setDescription( description );
4779+ this.accepted = true;
4780+ }
4781+
4782+ public boolean isAccepted(){
4783+ return this.accepted;
4784+ }
4785+}
4786
4787=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSong.java'
4788--- TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSong.java 1970-01-01 00:00:00 +0000
4789+++ TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSong.java 2010-05-21 18:17:28 +0000
4790@@ -0,0 +1,131 @@
4791+package org.herac.tuxguitar.community.io;
4792+
4793+import java.io.ByteArrayOutputStream;
4794+import java.util.ArrayList;
4795+import java.util.Iterator;
4796+import java.util.List;
4797+
4798+import org.eclipse.swt.SWT;
4799+import org.herac.tuxguitar.community.auth.TGCommunityAuthDialog;
4800+import org.herac.tuxguitar.gui.TuxGuitar;
4801+import org.herac.tuxguitar.gui.actions.ActionLock;
4802+import org.herac.tuxguitar.gui.util.MessageDialog;
4803+import org.herac.tuxguitar.io.base.TGOutputStreamBase;
4804+import org.herac.tuxguitar.io.tg.TGOutputStream;
4805+import org.herac.tuxguitar.song.factory.TGFactory;
4806+import org.herac.tuxguitar.song.models.TGSong;
4807+import org.herac.tuxguitar.util.TGSynchronizer;
4808+
4809+public class TGShareSong {
4810+
4811+ public TGShareSong( ) {
4812+ super();
4813+ }
4814+
4815+ public void process( TGSong song ) {
4816+ try {
4817+ TGShareFile file = new TGShareFile();
4818+ file.setFile( getSongBytes( song ) );
4819+ this.processDialog(file , null );
4820+ } catch (Throwable throwable ){
4821+ MessageDialog.errorMessage(throwable);
4822+ }
4823+ }
4824+
4825+ public void processDialog( final TGShareFile file , final String errors ) {
4826+ try {
4827+ TGSynchronizer.instance().runLater(new TGSynchronizer.TGRunnable() {
4828+ public void run() throws Throwable {
4829+ TGShareFileDialog fileDialog = new TGShareFileDialog( file , errors );
4830+ fileDialog.open();
4831+ if( fileDialog.isAccepted() ){
4832+ processUpload( file );
4833+ }
4834+ }
4835+ });
4836+ } catch (Throwable throwable ){
4837+ MessageDialog.errorMessage(throwable);
4838+ }
4839+ }
4840+
4841+ public void processAuthDialog( final TGShareFile file ) {
4842+ try {
4843+ TGSynchronizer.instance().runLater(new TGSynchronizer.TGRunnable() {
4844+ public void run() throws Throwable {
4845+ TGCommunityAuthDialog authDialog = new TGCommunityAuthDialog();
4846+ authDialog.open();
4847+ if( authDialog.isAccepted() ){
4848+ processUpload( file );
4849+ }
4850+ }
4851+ });
4852+ } catch (Throwable throwable ){
4853+ MessageDialog.errorMessage(throwable);
4854+ }
4855+ }
4856+
4857+ public void processUpload( final TGShareFile file ) {
4858+ this.setActiveMode();
4859+
4860+ new Thread( new Runnable() {
4861+ public void run() {
4862+ try {
4863+ TGShareSongConnection share = new TGShareSongConnection();
4864+ share.uploadFile(file , TGShareSong.this );
4865+ } catch (Throwable throwable ){
4866+ MessageDialog.errorMessage(throwable);
4867+ }
4868+ }
4869+ } ).start();
4870+ }
4871+
4872+ public void processResult( TGShareSongResponse response, TGShareFile file ){
4873+ this.setPasiveMode();
4874+
4875+ try {
4876+ String status = response.getStatus();
4877+ if( status != null && status.equals(TGShareSongConnection.HTTP_STATUS_OK) ){
4878+ MessageDialog.infoMessage("File Uploaded", "File upload completed!!");
4879+ }
4880+ else if( status != null && status.equals(TGShareSongConnection.HTTP_STATUS_UNAUTHORIZED) ){
4881+ processAuthDialog( file );
4882+ }
4883+ else if( status != null && status.equals(TGShareSongConnection.HTTP_STATUS_INVALID) ){
4884+ String message = new String();
4885+ List messages = new ArrayList();
4886+ response.loadMessages( messages );
4887+ Iterator it = messages.iterator();
4888+ while( it.hasNext() ){
4889+ message += ( (String) it.next() + "\r\n" );
4890+ }
4891+ processDialog( file , message );
4892+ }
4893+ else{
4894+ processDialog( file , "Error: " + status );
4895+ }
4896+ } catch (Throwable throwable ){
4897+ MessageDialog.errorMessage(throwable);
4898+ }
4899+ }
4900+
4901+ private byte[] getSongBytes( TGSong song ) throws Throwable {
4902+ ByteArrayOutputStream out = new ByteArrayOutputStream();
4903+ TGOutputStreamBase tgStream = new TGOutputStream();
4904+ tgStream.init( new TGFactory() , out );
4905+ tgStream.writeSong(song);
4906+ out.close();
4907+ return out.toByteArray();
4908+ }
4909+
4910+ public void setActiveMode(){
4911+ TuxGuitar.instance().lock();
4912+ TuxGuitar.instance().loadCursor(SWT.CURSOR_WAIT);
4913+ ActionLock.lock();
4914+ }
4915+
4916+ public void setPasiveMode(){
4917+ ActionLock.unlock();
4918+ TuxGuitar.instance().loadCursor(SWT.CURSOR_ARROW);
4919+ TuxGuitar.instance().unlock();
4920+ }
4921+}
4922
4923=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongConnection.java'
4924--- TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongConnection.java 1970-01-01 00:00:00 +0000
4925+++ TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongConnection.java 2010-05-21 18:17:28 +0000
4926@@ -0,0 +1,29 @@
4927+package org.herac.tuxguitar.community.io;
4928+
4929+import org.herac.tuxguitar.community.TGCommunitySingleton;
4930+import org.herac.tuxguitar.community.auth.TGCommunityAuth;
4931+
4932+public class TGShareSongConnection {
4933+
4934+ public static final String HTTP_STATUS_OK = "200";
4935+ public static final String HTTP_STATUS_UNAUTHORIZED = "401";
4936+ public static final String HTTP_STATUS_INVALID = "400";
4937+
4938+ private String status;
4939+ private TGCommunityAuth auth;
4940+
4941+ public TGShareSongConnection(){
4942+ this.auth = TGCommunitySingleton.getInstance().getAuth();
4943+ this.auth.update();
4944+ }
4945+
4946+ public void uploadFile( TGShareFile file , TGShareSong callback ) throws Throwable {
4947+ TGShareSongRequest request = new TGShareSongRequest(this.auth, file);
4948+ TGShareSongResponse response = request.getResponse();
4949+ callback.processResult(response, file);
4950+ }
4951+
4952+ public String getStatus(){
4953+ return this.status;
4954+ }
4955+}
4956
4957=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongExporter.java'
4958--- TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongExporter.java 1970-01-01 00:00:00 +0000
4959+++ TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongExporter.java 2010-05-21 18:17:28 +0000
4960@@ -0,0 +1,26 @@
4961+package org.herac.tuxguitar.community.io;
4962+
4963+import org.herac.tuxguitar.io.base.TGFileFormatException;
4964+import org.herac.tuxguitar.io.base.TGRawExporter;
4965+import org.herac.tuxguitar.song.factory.TGFactory;
4966+import org.herac.tuxguitar.song.models.TGSong;
4967+
4968+public class TGShareSongExporter implements TGRawExporter {
4969+
4970+ public TGShareSongExporter(){
4971+ super();
4972+ }
4973+
4974+ public void exportSong(TGSong srcSong) throws TGFileFormatException {
4975+ final TGSong song = srcSong.clone(new TGFactory());
4976+ new Thread( new Runnable() {
4977+ public void run() {
4978+ new TGShareSong().process( song );
4979+ }
4980+ } ).start();
4981+ }
4982+
4983+ public String getExportName() {
4984+ return ("Share with the Community");
4985+ }
4986+}
4987
4988=== added file 'TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongPlugin.java'
4989--- TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongPlugin.java 1970-01-01 00:00:00 +0000
4990+++ TuxGuitar-community/src/org/herac/tuxguitar/community/io/TGShareSongPlugin.java 2010-05-21 18:17:28 +0000
4991@@ -0,0 +1,12 @@
4992+package org.herac.tuxguitar.community.io;
4993+
4994+import org.herac.tuxguitar.gui.system.plugins.TGPluginException;
4995+import org.herac.tuxguitar.gui.system.plugins.base.TGExporterPlugin;
4996+import org.herac.tuxguitar.io.base.TGRawExporter;
4997+
4998+public class TGShareSongPlugin extends TGExporterPlugin {
4999+
5000+ protected TGRawExporter getExporter() throws TGPluginException {
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: