mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-22 08:16:56 +00:00
Removed simultaneous voice recording.
This commit is contained in:
parent
7bf9db8644
commit
176f3ea15c
@ -4351,6 +4351,7 @@ bool HistoryWidget::isSearching() const {
|
||||
bool HistoryWidget::showRecordButton() const {
|
||||
return Media::Capture::instance()->available()
|
||||
&& !_voiceRecordBar->isListenState()
|
||||
&& !_voiceRecordBar->isRecordingByAnotherBar()
|
||||
&& !HasSendText(_field)
|
||||
&& !readyToForward()
|
||||
&& !_editMsgId;
|
||||
|
@ -1333,6 +1333,7 @@ void ComposeControls::orderControls() {
|
||||
bool ComposeControls::showRecordButton() const {
|
||||
return ::Media::Capture::instance()->available()
|
||||
&& !_voiceRecordBar->isListenState()
|
||||
&& !_voiceRecordBar->isRecordingByAnotherBar()
|
||||
&& !HasSendText(_field)
|
||||
//&& !readyToForward()
|
||||
&& !isEditingMessage();
|
||||
|
@ -1541,7 +1541,13 @@ rpl::producer<not_null<QEvent*>> VoiceRecordBar::lockViewportEvents() const {
|
||||
}
|
||||
|
||||
rpl::producer<> VoiceRecordBar::updateSendButtonTypeRequests() const {
|
||||
return _listenChanges.events();
|
||||
return rpl::merge(
|
||||
::Media::Capture::instance()->startedChanges(
|
||||
) | rpl::filter([=] {
|
||||
// Perhaps a voice is recording from another place.
|
||||
return !isActive();
|
||||
}) | rpl::to_empty,
|
||||
_listenChanges.events());
|
||||
}
|
||||
|
||||
rpl::producer<> VoiceRecordBar::recordingTipRequests() const {
|
||||
@ -1560,6 +1566,10 @@ bool VoiceRecordBar::isTypeRecord() const {
|
||||
return (_send->type() == Ui::SendButton::Type::Record);
|
||||
}
|
||||
|
||||
bool VoiceRecordBar::isRecordingByAnotherBar() const {
|
||||
return !isRecording() && ::Media::Capture::instance()->started();
|
||||
}
|
||||
|
||||
bool VoiceRecordBar::hasDuration() const {
|
||||
return _recordingSamples > 0;
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ public:
|
||||
[[nodiscard]] bool isLockPresent() const;
|
||||
[[nodiscard]] bool isListenState() const;
|
||||
[[nodiscard]] bool isActive() const;
|
||||
[[nodiscard]] bool isRecordingByAnotherBar() const;
|
||||
|
||||
private:
|
||||
enum class StopType {
|
||||
|
@ -42,6 +42,9 @@ public:
|
||||
return _updates.events();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool started() const {
|
||||
return _started.current();
|
||||
}
|
||||
[[nodiscard]] rpl::producer<bool> startedChanges() const {
|
||||
return _started.changes();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user