~ubuntu-branches/debian/stretch/synthv1/stretch

« back to all changes in this revision

Viewing changes to src/synthv1_jack.cpp

  • Committer: Package Import Robot
  • Author(s): Jaromír Mikeš
  • Date: 2014-03-11 15:08:33 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140311150833-hdd95xtc6ks4lwv5
Tags: 0.4.0-1
* Imported Upstream version 0.4.0
* Two patches removed - applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// synthv1_jack.cpp
2
2
//
3
3
/****************************************************************************
4
 
   Copyright (C) 2012-2013, rncbc aka Rui Nuno Capela. All rights reserved.
 
4
   Copyright (C) 2012-2014, rncbc aka Rui Nuno Capela. All rights reserved.
5
5
 
6
6
   This program is free software; you can redistribute it and/or
7
7
   modify it under the terms of the GNU General Public License
156
156
 
157
157
synthv1_jack::~synthv1_jack (void)
158
158
{
159
 
//      deactivate();
160
 
//      close();
 
159
        deactivate();
 
160
        close();
161
161
}
162
162
 
163
163
 
336
336
        if (m_client == NULL)
337
337
                return;
338
338
 
339
 
#ifdef CONFIG_ALSA_MIDI
340
 
        // close alsa sequencer client...
341
 
        if (m_alsa_seq) {
342
 
                if (m_alsa_thread) {
343
 
                        delete m_alsa_thread;
344
 
                        m_alsa_thread = NULL;
345
 
                }
346
 
                if (m_alsa_buffer) {
347
 
                        ::jack_ringbuffer_free(m_alsa_buffer);
348
 
                        m_alsa_buffer = NULL;
349
 
                }
350
 
                if (m_alsa_decoder) {
351
 
                        snd_midi_event_free(m_alsa_decoder);
352
 
                        m_alsa_decoder = NULL;
353
 
                }
354
 
                if (m_alsa_port >= 0) {
355
 
                        snd_seq_delete_simple_port(m_alsa_seq, m_alsa_port);
356
 
                        m_alsa_port = -1;
357
 
                }
358
 
                snd_seq_close(m_alsa_seq);
359
 
        //      m_alsa_client = -1;
360
 
                m_alsa_seq = NULL;
361
 
        }
362
 
#endif
363
 
 
364
339
#ifdef CONFIG_JACK_MIDI
365
340
        // unregister midi ports
366
341
        if (m_midi_in) {
408
383
        // close client
409
384
        ::jack_client_close(m_client);
410
385
        m_client = NULL;
 
386
 
 
387
#ifdef CONFIG_ALSA_MIDI
 
388
        // close alsa sequencer client...
 
389
        if (m_alsa_seq) {
 
390
                if (m_alsa_thread) {
 
391
                        delete m_alsa_thread;
 
392
                        m_alsa_thread = NULL;
 
393
                }
 
394
                if (m_alsa_buffer) {
 
395
                        ::jack_ringbuffer_free(m_alsa_buffer);
 
396
                        m_alsa_buffer = NULL;
 
397
                }
 
398
                if (m_alsa_decoder) {
 
399
                        snd_midi_event_free(m_alsa_decoder);
 
400
                        m_alsa_decoder = NULL;
 
401
                }
 
402
                if (m_alsa_port >= 0) {
 
403
                        snd_seq_delete_simple_port(m_alsa_seq, m_alsa_port);
 
404
                        m_alsa_port = -1;
 
405
                }
 
406
                snd_seq_close(m_alsa_seq);
 
407
        //      m_alsa_client = -1;
 
408
                m_alsa_seq = NULL;
 
409
        }
 
410
#endif
411
411
}
412
412
 
413
413