- media_async: thread-per-task async engine with primitives (sha256, sign, copy, uuid, file_size) - media_index: media_files DB table with register_async for indexing chunks - chat_msg: async media submission via register_async, simplified chat_msg_submit fields - voice_recorder/attachment_sender: write single file (no chunk splitting on caller side) - inputbar/messagelist: updated to new simplified submit interface - test_media_async: 4-thread stress test (200K ops / 2 sec, 0 errors) - test_media_index: 9 cases covering commit edge cases + async flow - build: Makefile.am, CMakeLists.txt, utun_sources.cmake updated
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
|
|
class QTextEdit;
|
|
class QPushButton;
|
|
class QLabel;
|
|
class QProgressBar;
|
|
class EmojiPanel;
|
|
class AudioRecorder;
|
|
|
|
class InputBar : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit InputBar(EmojiPanel *emojiPanel, AudioRecorder *recorder,
|
|
QWidget *parent = nullptr);
|
|
|
|
void setRecordingContext(const QString& mediaDirBase, const QString& channelId);
|
|
|
|
signals:
|
|
void sendMessage(const QString &text);
|
|
void sendVoiceMessage(const QString& mediaSrc, const QString& mediaDest,
|
|
int durationMs, const QString& waveformStr);
|
|
void sendFileAttachment(const QString& mediaSrc, const QString& mediaDest,
|
|
const QString& displayName);
|
|
|
|
protected:
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
void resizeEvent(QResizeEvent* event) override;
|
|
|
|
private slots:
|
|
void onSendClicked();
|
|
void adjustInputHeight();
|
|
void onPttPressed();
|
|
void onPttReleased();
|
|
void onAttachClicked();
|
|
void updateRecordingUI(int ms);
|
|
void showRecordOverlay();
|
|
void hideRecordOverlay();
|
|
|
|
private:
|
|
QTextEdit *m_input;
|
|
QPushButton *m_emojiBtn;
|
|
QPushButton *m_pttBtn;
|
|
QPushButton *m_attachBtn = nullptr;
|
|
EmojiPanel *m_emojiPanel;
|
|
AudioRecorder *m_recorder;
|
|
QWidget *m_recordOverlay = nullptr;
|
|
QLabel *m_recordLabel = nullptr;
|
|
QPushButton *m_cancelRecBtn = nullptr;
|
|
QProgressBar *m_levelBar = nullptr;
|
|
bool m_pttActive = false;
|
|
QString m_voiceFilePath;
|
|
QString m_mediaDirBase;
|
|
QString m_channelIdForRecord;
|
|
};
|