--- nono/vm/sound.h 2026/04/29 17:05:55 1.1.1.1 +++ nono/vm/sound.h 2026/04/29 17:06:01 1.1.1.2 @@ -16,6 +16,7 @@ #include #include +class BitmapRGBX; class Syncer; class HostSoundDevice; @@ -31,7 +32,7 @@ class Sound // 1ブロックの時間。 // ADPCM の制約からこれ以上小さくは出来ない(し大きくする必要もない)。 - static constexpr uint64 BLK_NSEC = 40_msec; + static constexpr uint64 BLK_TSEC = 40_msec; // サウンドソースのブロック数。 // ダブルバッファ方式なので 2。 @@ -101,6 +102,9 @@ class SoundRenderer : public ThreadDevic static constexpr uint32 REQ_TERMINATE = 0x80000000; static constexpr uint32 REQ_RECONFIG = 0x00000001; + static constexpr int METER_LEN = 20; // メータ部分の文字数 + static constexpr int METER_DIV = 3; // 1文字あたりの dbFS + public: SoundRenderer(); ~SoundRenderer() override; @@ -131,8 +135,9 @@ class SoundRenderer : public ThreadDevic void AddPCM(int16 *dst, const int16 *src); void CalcDBFS(std::array& dbFS, const int16 *src); - DECLARE_MONITOR_CALLBACK(MonitorUpdate); - void MonitorUpdateLevelMeter(TextScreen&, int x, int y, + DECLARE_MONITOR_SCREEN(MonitorScreen); + DECLARE_MONITOR_BITMAP(MonitorBitmap); + void MonitorScreenLevelMeter(TextScreen&, int x, int y, const std::array dbfs); // VM スレッドからの通知用。 @@ -187,6 +192,6 @@ class SoundRenderer : public ThreadDevic Syncer *syncer {}; }; -static inline SoundRenderer *GetSoundRenderer() { +inline SoundRenderer *GetSoundRenderer() { return Object::GetObject(OBJ_SOUND_RENDERER); }