Subversion Repositories svn.mios32

Rev

Rev 1759 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1759 Rev 2180
Line 1... Line 1...
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
2
// $Id: SysexTool.cpp 1759 2013-04-26 22:25:16Z tk $
2
// $Id: SysexTool.cpp 2180 2015-06-14 19:21:59Z tk $
3
/*
3
/*
4
 * SysEx Tool Window
4
 * SysEx Tool Window
5
 *
5
 *
6
 * ==========================================================================
6
 * ==========================================================================
7
 *
7
 *
Line 357... Line 357...
357
    if( buttonThatWasClicked == receiveStartButton ) {
357
    if( buttonThatWasClicked == receiveStartButton ) {
358
        receiveStartButton->setEnabled(false);
358
        receiveStartButton->setEnabled(false);
359
        receiveStopButton->setEnabled(true);
359
        receiveStopButton->setEnabled(true);
360
        receiveFileChooser->setEnabled(false);
360
        receiveFileChooser->setEnabled(false);
361
        receivedData.clear();
361
        receivedData.clear();
362
        statusLabel->setText(String(receivedData.size()) + T(" bytes received"), true);
362
        statusLabel->setText(String(receivedData.size()) + T(" bytes received"), sendNotification);
363
    } else if( buttonThatWasClicked == receiveStopButton ) {
363
    } else if( buttonThatWasClicked == receiveStopButton ) {
364
        receiveStopButton->setEnabled(false);
364
        receiveStopButton->setEnabled(false);
365
        receiveStartButton->setEnabled(true);
365
        receiveStartButton->setEnabled(true);
366
        receiveFileChooser->setEnabled(true);
366
        receiveFileChooser->setEnabled(true);
367
        if( receivedData.size() > 0 )
367
        if( receivedData.size() > 0 )
Line 396... Line 396...
396
                                            String::empty);
396
                                            String::empty);
397
            } else {
397
            } else {
398
                uint8 *data = &saveData.getReference(0);
398
                uint8 *data = &saveData.getReference(0);
399
                outFileStream->write(data, saveData.size());
399
                outFileStream->write(data, saveData.size());
400
                delete outFileStream;
400
                delete outFileStream;
401
                statusLabel->setText(String(saveData.size()) + T(" bytes saved"), true);
401
                statusLabel->setText(String(saveData.size()) + T(" bytes saved"), sendNotification);
402
            }
402
            }
403
        }
403
        }
404
404
405
        // store setting
405
        // store setting
406
        PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
406
        PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
Line 417... Line 417...
417
void SysexToolReceive::handleIncomingMidiMessage(const MidiMessage& message, uint8 runningStatus)
417
void SysexToolReceive::handleIncomingMidiMessage(const MidiMessage& message, uint8 runningStatus)
418
{
418
{
419
    if( !receiveStartButton->isEnabled() ) { // !enabled means that we are ready for receive
419
    if( !receiveStartButton->isEnabled() ) { // !enabled means that we are ready for receive
420
        Array<uint8> data(message.getRawData(), message.getRawDataSize());
420
        Array<uint8> data(message.getRawData(), message.getRawDataSize());
421
        receivedData.addArray(data);
421
        receivedData.addArray(data);
422
        statusLabel->setText(String(receivedData.size()) + T(" bytes received"), true);
422
        statusLabel->setText(String(receivedData.size()) + T(" bytes received"), sendNotification);
423
    }
423
    }
424
}
424
}
425
425
426
426
427
//==============================================================================
427
//==============================================================================