Skip to content

Commit

Permalink
Merge branch 'fix-lint'
Browse files Browse the repository at this point in the history
* Branch commit log:
  ase/combo.cc: fix includes
  ase/clapdevice.cc: fix includes
  ase/device.cc: fix includes
  ui/b/clipview.js: write proper todo comment
  ase/inifile.cc: write proper todo comment
  ase/gtk2wrap.cc: write proper todo comment
  ase/engine.cc: write proper todo comment
  ase/driver.cc: fix comment
  ase/driver-alsa.cc: fix cpp cond
  ase/device.cc: write proper todo comment
  ase/combo.cc: write proper todo comments
  ase/clapplugin.cc: fix includes
  ui/b/positionview.js: write proper todo comments
  ui/b/propgroup.js: write proper todo comment
  ase/clapdevice.cc: write proper todo comments

Signed-off-by: Tim Janik <timj@gnu.org>
  • Loading branch information
tim-janik committed Apr 27, 2024
2 parents 60f501a + 3dc7257 commit ad00599
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 48 deletions.
13 changes: 3 additions & 10 deletions ase/clapdevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@
#include "clapplugin.hh"
#include "project.hh"
#include "processor.hh"
#include "compress.hh"
#include "properties.hh"
#include "storage.hh"
#include "jsonipc/jsonipc.hh"
#include "path.hh"
#include "main.hh"
#include "serialize.hh"
#include "internal.hh"
#include "gtk2wrap.hh"
#include <dlfcn.h>

#define CDEBUG(...) Ase::debug ("clap", __VA_ARGS__)
Expand Down Expand Up @@ -247,7 +240,7 @@ ClapDeviceImpl::list_clap_plugins ()
if (devs.size())
return devs;
for (ClapPluginDescriptor *descriptor : ClapPluginDescriptor::collect_descriptors()) {
std::string title = descriptor->name; // FIXME
std::string title = descriptor->name;
if (!descriptor->version.empty())
title = title + " " + descriptor->version;
if (!descriptor->vendor.empty())
Expand All @@ -266,13 +259,13 @@ ClapDeviceImpl::_audio_processor () const
void
ClapDeviceImpl::_set_event_source (AudioProcessorP esource)
{
// FIXME: implement
// TODO: _set_event_source may be needed for nested plugins
}

void
ClapDeviceImpl::_disconnect_remove ()
{
// FIXME: implement
// TODO: this needs adjustments when _set_event_source is implemented
}

String
Expand Down
1 change: 0 additions & 1 deletion ase/clapplugin.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
#include "clapplugin.hh"
#include "clapdevice.hh"
#include "jsonipc/jsonipc.hh"
#include "storage.hh"
#include "project.hh"
#include "processor.hh"
Expand Down
3 changes: 1 addition & 2 deletions ase/combo.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
#include "combo.hh"
#include "randomhash.hh"
#include "server.hh"
#include "internal.hh"

Expand Down Expand Up @@ -219,7 +218,7 @@ AudioChain::render (uint n_frames)
}
}
}
// FIXME: assign obus if no children are present
// TODO: do we need to assign oblock when no children are present?
}

/// Reconnect AudioChain child processors at start and after.
Expand Down
11 changes: 3 additions & 8 deletions ase/device.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
#include "device.hh"
#include "nativedevice.hh"
#include "combo.hh"
#include "project.hh"
#include "jsonipc/jsonipc.hh"
#include "serialize.hh"
#include "internal.hh"

namespace Ase {
Expand Down Expand Up @@ -46,14 +41,14 @@ DeviceImpl::_disconnect_remove ()
AudioProcessorP proc = _audio_processor();
return_unless (proc);
AudioEngine *engine = &proc->engine();
auto j = [proc] () {
auto job = [proc] () {
proc->enable_engine_output (false);
proc->disconnect_ibuses();
proc->disconnect_obuses();
proc->disconnect_event_input();
// FIXME: remove from combo container if child
// TODO: do we need to remove this from parent container (combo)?
};
engine->async_jobs += j;
engine->async_jobs += job;
}

DeviceInfo
Expand Down
4 changes: 3 additions & 1 deletion ase/driver-alsa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1109,11 +1109,13 @@ class AlsaSeqMidiDriver : public MidiDriver {
flags_ &= ~size_t (Flags::OPENED | Flags::READABLE | Flags::WRITABLE);
mdebug_ = false;
}
#if WITH_MIDI_POLL
static void
pollfree_func (void *data) // FIXME: needed?
pollfree_func (void *data)
{
// AlsaSeqMidiDriver *thisp = (AlsaSeqMidiDriver*) data;
}
#endif
double
queue_now ()
{
Expand Down
2 changes: 1 addition & 1 deletion ase/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class NullMidiDriver : public MidiDriver {
uint
fetch_events (MidiEventOutput&, double) override
{
return 0; // FIXME: needed?
return 0;
}
static void
list_drivers (Driver::EntryVec &entries)
Expand Down
24 changes: 12 additions & 12 deletions ase/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,19 +286,20 @@ void
AudioEngineThread::run (StartQueue *sq)
{
assert_return (null_pcm_driver_);
assert_return (owner_wakeup_ != nullptr);
if (!pcm_driver_)
pcm_driver_ = null_pcm_driver_;
floatfill (chbuffer_data_, 0.0, MAX_BUFFER_SIZE * fixed_n_channels);
buffer_size_ = std::min (MAX_BUFFER_SIZE, size_t (pcm_driver_->pcm_block_length()));
write_stamp_ = render_stamp_ - buffer_size_; // write an initial buffer of zeros
// FIXME: assert owner_wakeup and free trash
this_thread_set_name ("AudioEngine-0"); // max 16 chars
audio_engine_thread_id = std::this_thread::get_id();
sched_fast_priority (this_thread_gettid());
event_loop_->exec_dispatcher (std::bind (&AudioEngineThread::driver_dispatcher, this, std::placeholders::_1));
sq->push ('R'); // StartQueue becomes invalid after this call
sq = nullptr;
event_loop_->run();
// TODO: do we need to cleanup / throw away job lists here?
}

bool
Expand Down Expand Up @@ -348,36 +349,35 @@ AudioEngineThread::driver_dispatcher (const LoopState &state)
/* fall-through */
case LoopState::CHECK:
if (atquit_triggered())
return false; // stall engine once program is aborted
return false; // stall engine once program is aborted
if (!const_jobs_.empty() || !async_jobs_.empty())
return true; // jobs pending
return true; // jobs pending
if (render_stamp_ <= write_stamp_)
return true; // must render
// FIXME: add pcm driver pollfd with 1-block threshold
return true; // must render
return pcm_check_write (false, timeout_usecs);
case LoopState::DISPATCH:
pcm_check_write (true);
if (render_stamp_ <= write_stamp_)
{
process_jobs (async_jobs_); // apply pending modifications before render
process_jobs (async_jobs_); // apply pending modifications before render
if (schedule_invalid_)
{
schedule_clear();
for (AudioProcessorP &proc : oprocs_)
proc->schedule_processor();
schedule_invalid_ = false;
}
if (render_stamp_ <= write_stamp_) // async jobs may have adjusted stamps
if (render_stamp_ <= write_stamp_) // async jobs may have adjusted stamps
schedule_render (buffer_size_);
pcm_check_write (true); // minimize drop outs
pcm_check_write (true); // minimize drop outs
}
if (!const_jobs_.empty()) { // owner may be blocking for const_jobs_ execution
process_jobs (async_jobs_); // apply pending modifications first
if (!const_jobs_.empty()) { // owner may be blocking for const_jobs_ execution
process_jobs (async_jobs_); // apply pending modifications first
process_jobs (const_jobs_);
}
if (ipc_pending())
owner_wakeup_(); // owner needs to ipc_dispatch()
return true; // keep alive
owner_wakeup_(); // owner needs to ipc_dispatch()
return true; // keep alive
default: ;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion ase/gtk2wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ hide_window (ulong windowid)
template<typename Ret, typename ...Args, typename ...Params> static Ret
gtkidle_call (Ret (*func) (Params...), Args &&...args)
{
if (!gtkthred) // FIXME: need thread cleanup
if (!gtkthred) // TODO: clean this up on process exit
gtkthred = new std::thread (gtkmain);
Semaphore sem;
Ret ret = {};
Expand Down
16 changes: 8 additions & 8 deletions ase/inifile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ namespace Ase {
* @endcode
*/

/* FIXME: possible IniFile improvements
- support \xUUUU unicode escapes in strings
- support \s for space (desktop-entry-spec)
- support value list parsing, using ';' as delimiters
- support current locale matching, including locale aliases
- support merging of duplicates
- support %(var) interpolation like Pyton's configparser.ConfigParser
- parse into vector<IniEntry> which are: { kind=(section|assignment|other); String text, comment; }
/* TODO: possible IniFile improvements
* - support \xUUUU unicode escapes in strings
* - support \s for space (desktop-entry-spec)
* - support value list parsing, using ';' as delimiters
* - support current locale matching, including locale aliases
* - support merging of duplicates
* - support %(var) interpolation like Pyton's configparser.ConfigParser
* - parse into vector<IniEntry> which are: { kind=(section|assignment|other); String text, comment; }
*/

static bool
Expand Down
2 changes: 1 addition & 1 deletion ui/b/clipview.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class BClipView extends LitComponent {
this.wclip_ = null;
this.canvas = null;
this.starttick = 0;
this.end_tick = null; // FIXME
this.end_tick = null; // TODO: remove or fetch from ASE
this.trackindex = -1;
this.tickscale = 10.0 / Util.PPQN; // TODO: adjust hzoom
this.notes_changed = () => this.repaint (false);
Expand Down
2 changes: 1 addition & 1 deletion ui/b/positionview.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BPositionView extends LitComponent {
super.connectedCallback();
let project = Data.project;
if (!project.bpm) {
// FIXME: work around until the TimeSignature branch is merged
// TODO: work around until the TimeSignature branch is merged
project = Object.create (project);
for (const key of ['bpm', 'numerator', 'denominator'])
project[key] = () => project.get_value (key);
Expand Down
4 changes: 2 additions & 2 deletions ui/b/propgroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class BPropGroup extends LitComponent {
{
const hints = ':' + prop.hints_ + ':';
let c = '';
if (prop.is_numeric_ && hints.search (/:big:/) < 0) // FIXME: test "big" hint
c += 'b-propgroup-big';
if (prop.is_numeric_ && hints.search (/:big:/) < 0)
c += 'b-propgroup-big'; // TODO: actually test "big" layout
return c;
}
assign_layout_rows (props)
Expand Down

0 comments on commit ad00599

Please sign in to comment.