summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Changing the message box for failure to open MIDI.HEADmasterKaz Kylheku2013-09-291-3/+22
| | | | | | | | | | | When Sekaiju cannot open a MIDI device; if you click OK on the dialog box, it will just forget the device. The new behavior is not great, but better: an Abort, Retry, Ignore error dialog is shown instead. Abort will forget the nonworking MIDI device (same as OK) before. Ignore will keep the device in the list. Retry will try opening it again: very useful for plugging in a USB MIDI adapter and trying again.
* Implementing "record metronome" feature.Kaz Kylheku2013-09-285-14/+56
|
* Fixing a clipboard-related application crash.Kaz Kylheku2013-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I discovered this when Sekaiju crashed when I tried to copy some notes around within a track using cut and paste. Steps to reproduce: Simply create a large amount of musical material (say on the order of dozens or hundreds of events). Then in the tracks view do "select all", and try to cut or copy the material with the context popup menu, or the shortcuts. Sekaiju will crash. If not, just increase the amount of material and keep trying. With this change i have repeatedly cut, copied and pasted thousands of MIDI events, repeatedly, without any crash. The bug is that the clipboard publishing function CSekaijuDoc::SetClipboardTextPrivate9 calculates the clipboard size in characters but then allocates that many bytes for the text rather than characters! The 32 byte padding which was there doesn't help, except when the data being put into the clipboard is very small. All we need is to allocate the correct string size, in bytes, which is (length + 1) * sizeof(TCHAR).
* Fixing a bug: the accented beat of the metronome does not play reliably.Kaz Kylheku2013-09-171-27/+26
| | | | | | | | | | | | | | | | | | | | Steps to reproduce: - rewind the position - press record Sometimes, the accented beat is not heard. I suspected race conditions at first, so I restructured the order of operations in CSekaijuApp::StartRecording so that the MIDI clock is not started until the very end, when all the state variables have been assigned, like m_bPlaying and m_bRecording. I'm keeping these changes. But the real problem was in CSekaijuApp::PlayRecordProc, in the block of code that plays the metronome. There, the check "pSekaijuDoc->m_lOldTime == pSekaijuDoc->m_lNewTime" was causing the issue. Although StartRecording sets up this condition, there is no way for the truth of the condition to be maintained through to that block of code. The clock runs freely, and is periodically sampled by the thread whenever it wakes up from sleep. The condition is not necessary.
* This commit solves a remaining problem of events accidentally looping backKaz Kylheku2013-09-171-173/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | during recording when midi through is disabled in the binding array. The problem is caused by the fact that the real-time events are inserted into the tracks just at the start of the next clock period. When the next clock period comes, those events are played back! (This also causes a delay: since the looped notes will not play until the next clock advance!) To solve this problem we do two things: 1. Rearrange the processing so that playback, metronome generation et cetera are handled first in every processing period, and the real-time input is handled afterward. 2. Now that real-time inputs are handled after playback, we can simply insert them into the CURRENT time period. Since playback is already done for the current time period before, they will not be played. Referring new events into the current time period is done by subtracting one from the clock value. Sekaiju's logic for handling time periods is that each time period is an interval that excludes the current time: [old_time, new_time). So when an new event is inserted at new_time, it becomes part of the next period. By inserting an event at new_time - 1, we make it part of the current period. Hey, I wrote some comments in Japanese. :)
* SHIFT-JIS to UTF8 conversion.Kaz Kylheku2013-09-161-14/+14
|
* New feature: "MIDI thru" is implemented by bindings fromKaz Kylheku2013-09-167-28/+192
| | | | | | input ports to output ports which is user-configurable and stored in the .ini file. Tracks no longer perform "MIDI thru", but only capture and playback.
* Missing file added.Kaz Kylheku2013-09-151-0/+207
|
* Fix bug: some MIDI devices have spaces at the end of the name,Kaz Kylheku2013-09-151-4/+6
| | | | | | which must be preserved when we store such names in the .ini file. The .ini API will strip whitespace; but we can add quotes around a value to preserve it.
* Converted Sekaiju 3.6 to Visual Studio 2008.Kaz Kylheku2013-09-15179-0/+70661