Comments (3)
Hi Kaoru
I’d recommend to put all the driver setup into some separate class, a singleton, or all ‘static’ is fine too.
Then initialize that class on startup and destroy everything inside when the app gets terminated.
Having the midi setup in an activity is, from the software design point of view, not a very good practice, since there’s no guarantee how long an activity will live. Screen rotation is just one example.
Von: Kaoru Shoji [mailto:[email protected]]
Gesendet: Freitag, 8. Mai 2015 05:24
An: kshoji/USB-MIDI-Driver
Betreff: [USB-MIDI-Driver] OnMidiDeviceDetachedListener method doesn't called at the screen rotation (#38)
The execution of handler on MidiDeviceConnectionWatcher is blocked while the screen rotating.
After the new Activity's onCreate being called, the handler will be executed.
But the original Activity is already destroyed, so the original Activity can't receive detaching events.
—
Reply to this email directly or view it on GitHub #38 . https://github.com/notifications/beacon/AF5BLIYAZZW8dxFolc9snBIQe6niLO8eks5oHCPegaJpZM4ETQts.gif
from usb-midi-driver.
Hi,
I also think the Activity should not hold MIDI device instances.
Their instances should belong at Application, Service or something static object.
The sample code had written at long ago. It must be refined.
from usb-midi-driver.
Ah, OK, didn’t know that.
Agree, storing it in a custom application class would be even better than using a regular singleton
Von: Kaoru Shoji [mailto:[email protected]]
Gesendet: Freitag, 8. Mai 2015 11:24
An: kshoji/USB-MIDI-Driver
Cc: planethcom
Betreff: Re: [USB-MIDI-Driver] OnMidiDeviceDetachedListener method doesn't called at the screen rotation (#38)
Hi,
I also think the Activity should not hold MIDI device instances.
Their instances should belong at Application, Service or something static object.
The sample code had written at long ago. It must be refined.
—
Reply to this email directly or view it on GitHub #38 (comment) . https://github.com/notifications/beacon/AF5BLAI93qe5ZgKzb_mFhSWmA9Zpzp0Jks5oHHg8gaJpZM4ETQts.gif
from usb-midi-driver.
Related Issues (20)
- UsbMidiDriver.getConnectedUsbDevices() returns empty set
- OnMidiInputEventListenerImpl take interpret wrongly about single byte messages HOT 3
- Add some utility methods on Input/Output device class HOT 1
- trying to send this sysex message for example HOT 1
- Send Midi Out through 5 channels HOT 2
- Separate RPN/NRPN messages for each cableId. HOT 1
- Synthesizer doesn't be registered to MidiSystem
- Can't find a onMidiInEvent
- Audio stops when USB midi device is connected HOT 2
- sequencer.start() method not generating any sound in Android application.
- MIDI Input Broken on Android 4 HOT 34
- Some vendor ids are wrong in device_filter.xml HOT 1
- Trouble adding MidiDriver as a module to a project HOT 3
- Missing Midi Events HOT 5
- Support multi process?
- Sysex not working HOT 1
- Filter Out Active Sensing HOT 1
- WaiterThread will spin and crash device
- Issue with Android 12 and PendingIntent
- I don't see this library working when device is connected to computer or ipad HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from usb-midi-driver.