Browse Source

fix use of zix ring in rtaudio/rtmidi/windows builds

libpanel_detach
Alexandros Theodotou 2 months ago
parent
commit
e3d6f7b44d
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 10
      src/audio/port.c
  2. 5
      src/audio/router.c
  3. 21
      src/audio/rtaudio_device.c
  4. 21
      src/audio/rtmidi_device.c
  5. 1
      src/audio/windows_mme_device.c
  6. 6
      src/plugins/lv2/lv2_worker.c
  7. 8
      src/plugins/lv2_plugin.c

10
src/audio/port.c

@ -76,16 +76,18 @@ port_allocate_bufs (Port * self) @@ -76,16 +76,18 @@ port_allocate_bufs (Port * self)
self->midi_events = midi_events_new ();
object_free_w_func_and_null (
zix_ring_free, self->midi_ring);
self->midi_ring =
zix_ring_new (zix_default_allocator (), sizeof (MidiEvent) * (size_t) 11);
self->midi_ring = zix_ring_new (
zix_default_allocator (),
sizeof (MidiEvent) * (size_t) 11);
break;
case TYPE_AUDIO:
case TYPE_CV:
{
object_free_w_func_and_null (
zix_ring_free, self->audio_ring);
self->audio_ring =
zix_ring_new (zix_default_allocator (), sizeof (float) * AUDIO_RING_SIZE);
self->audio_ring = zix_ring_new (
zix_default_allocator (),
sizeof (float) * AUDIO_RING_SIZE);
object_zero_and_free (self->buf);
size_t max = MAX (
AUDIO_ENGINE->block_length, self->min_buf_size);

5
src/audio/router.c

@ -243,8 +243,9 @@ router_new (void) @@ -243,8 +243,9 @@ router_new (void)
zix_sem_init (&self->graph_access, 1);
self->ctrl_port_change_queue =
zix_ring_new (zix_default_allocator (), sizeof (ControlPortChange) * (size_t) 24);
self->ctrl_port_change_queue = zix_ring_new (
zix_default_allocator (),
sizeof (ControlPortChange) * (size_t) 24);
g_message ("done");

21
src/audio/rtaudio_device.c

@ -1,21 +1,5 @@ @@ -1,21 +1,5 @@
/*
* Copyright (C) 2020-2021 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
* Zrythm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zrythm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
// SPDX-License-Identifier: LicenseRef-ZrythmLicense
#include "zrythm-config.h"
@ -124,6 +108,7 @@ rtaudio_device_new ( @@ -124,6 +108,7 @@ rtaudio_device_new (
self->name = g_strdup (dev_nfo.name);
self->audio_ring = zix_ring_new (
zix_default_allocator (),
sizeof (float) * (size_t) RTAUDIO_DEVICE_BUFFER_SIZE);
zix_sem_init (&self->audio_ring_sem, 1);

21
src/audio/rtmidi_device.c

@ -1,21 +1,5 @@ @@ -1,21 +1,5 @@
/*
* Copyright (C) 2020-2021 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
* Zrythm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zrythm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
// SPDX-License-Identifier: LicenseRef-ZrythmLicense
#include "zrythm-config.h"
@ -234,6 +218,7 @@ rtmidi_device_new ( @@ -234,6 +218,7 @@ rtmidi_device_new (
/* TODO */
}
self->midi_ring = zix_ring_new (
zix_default_allocator (),
sizeof (uint8_t) * (size_t) MIDI_BUFFER_SIZE);
self->events = midi_events_new ();

1
src/audio/windows_mme_device.c

@ -90,6 +90,7 @@ windows_mme_device_new (int input, int index) @@ -90,6 +90,7 @@ windows_mme_device_new (int input, int index)
}
self->midi_ring = zix_ring_new (
zix_default_allocator (),
sizeof (uint8_t) * (size_t) MIDI_BUFFER_SIZE);
return self;

6
src/plugins/lv2/lv2_worker.c

@ -110,10 +110,12 @@ lv2_worker_init ( @@ -110,10 +110,12 @@ lv2_worker_init (
{
zix_thread_create (
&worker->thread, 4096, worker_func, worker);
worker->requests = zix_ring_new (zix_default_allocator (), 4096);
worker->requests =
zix_ring_new (zix_default_allocator (), 4096);
zix_ring_mlock (worker->requests);
}
worker->responses = zix_ring_new (zix_default_allocator (), 4096);
worker->responses =
zix_ring_new (zix_default_allocator (), 4096);
worker->response = malloc (4096);
zix_ring_mlock (worker->responses);
}

8
src/plugins/lv2_plugin.c

@ -2745,10 +2745,10 @@ lv2_plugin_instantiate ( @@ -2745,10 +2745,10 @@ lv2_plugin_instantiate (
/* Create Plugin <=> UI communication
* buffers */
self->ui_to_plugin_events =
zix_ring_new (zix_default_allocator (), self->comm_buffer_size);
self->plugin_to_ui_events =
zix_ring_new (zix_default_allocator (), self->comm_buffer_size);
self->ui_to_plugin_events = zix_ring_new (
zix_default_allocator (), self->comm_buffer_size);
self->plugin_to_ui_events = zix_ring_new (
zix_default_allocator (), self->comm_buffer_size);
zix_ring_mlock (self->ui_to_plugin_events);
zix_ring_mlock (self->plugin_to_ui_events);

Loading…
Cancel
Save