🧑💻 ExtUI::onPlayTone optional duration
This commit is contained in:
parent
dd3b5a10a0
commit
22fc07d72b
|
@ -49,7 +49,7 @@ namespace ExtUI {
|
|||
void onMediaError() { chiron.mediaEvent(AC_media_error); }
|
||||
void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); }
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
|
||||
#if ENABLED(SPEAKER)
|
||||
::tone(BEEPER_PIN, frequency, duration);
|
||||
#endif
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace ExtUI {
|
|||
void onMediaInserted() { anycubicTFT.onSDCardStateChange(true); }
|
||||
void onMediaError() { anycubicTFT.onSDCardError(); }
|
||||
void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); }
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
|
||||
TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration));
|
||||
}
|
||||
void onPrintTimerStarted() { anycubicTFT.onPrintTimerStarted(); }
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace ExtUI {
|
|||
void onMediaError() { dgus.mediaEvent(AC_media_error); }
|
||||
void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); }
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
|
||||
#if ENABLED(SPEAKER)
|
||||
::tone(BEEPER_PIN, frequency, duration);
|
||||
#endif
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace ExtUI {
|
|||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {}
|
||||
void onPrintTimerStarted() {}
|
||||
void onPrintTimerPaused() {}
|
||||
void onPrintTimerStopped() {}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "../../../../module/planner.h"
|
||||
|
||||
#include "../../ui_api.h"
|
||||
#include "../../../marlinui.h"
|
||||
#include "../../../marlinui.h" // For material presets
|
||||
|
||||
#if HAS_STEALTHCHOP
|
||||
#include "../../../../module/stepper/trinamic.h"
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
write(addr, static_cast<const void*>(&data), sizeof(T));
|
||||
}
|
||||
|
||||
// Until now I did not need to actively read from the display. That's why there is no ReadVariable
|
||||
// Until now I did not need to actively read from the display. That's why there is no readVariable
|
||||
// (I extensively use the auto upload of the display)
|
||||
|
||||
// Read GUI and OS version from screen
|
||||
|
|
|
@ -281,7 +281,7 @@ void DGUSScreenHandler::configurationStoreRead(bool success) {
|
|||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
|
||||
if (WITHIN(frequency, 1, 255)) {
|
||||
if (WITHIN(duration, 1, 255))
|
||||
dgus.playSound((uint8_t)frequency, (uint8_t)duration);
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
static void configurationStoreWritten(bool success);
|
||||
static void configurationStoreRead(bool success);
|
||||
|
||||
static void playTone(const uint16_t frequency, const uint16_t duration);
|
||||
static void playTone(const uint16_t frequency, const uint16_t duration=0);
|
||||
static void angryBeeps(const uint8_t beepCount);
|
||||
|
||||
static void levelingStart();
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace ExtUI {
|
|||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
|
||||
screen.playTone(frequency, duration);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
write(addr, static_cast<const void*>(&data), sizeof(T));
|
||||
}
|
||||
|
||||
// Until now I did not need to actively read from the display. That's why there is no ReadVariable
|
||||
// Until now I did not need to actively read from the display. That's why there is no readVariable
|
||||
// (I extensively use the auto upload of the display)
|
||||
|
||||
// Read GUI and OS version from screen
|
||||
|
|
|
@ -224,7 +224,7 @@ void DGUSScreenHandler::configurationStoreRead(bool success) {
|
|||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
|
||||
if (WITHIN(frequency, 1, 255)) {
|
||||
if (WITHIN(duration, 1, 255))
|
||||
dgus.playSound((uint8_t)frequency, (uint8_t)duration);
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
static void configurationStoreWritten(bool success);
|
||||
static void configurationStoreRead(bool success);
|
||||
|
||||
static void playTone(const uint16_t frequency, const uint16_t duration);
|
||||
static void playTone(const uint16_t frequency, const uint16_t duration=0);
|
||||
static void meshUpdate(const int8_t xpos, const int8_t ypos);
|
||||
static void printTimerStarted();
|
||||
static void printTimerPaused();
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace ExtUI {
|
|||
void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); }
|
||||
void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); }
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {
|
||||
screen.playTone(frequency, duration);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace ExtUI {
|
|||
void onMediaInserted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {}
|
||||
void onPrintTimerStarted() {}
|
||||
void onPrintTimerPaused() {}
|
||||
void onPrintTimerStopped() {}
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace ExtUI {
|
|||
}
|
||||
void onSettingsLoaded(const bool) {}
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); }
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { sound.play_tone(frequency, duration); }
|
||||
|
||||
void onUserConfirmRequired(const char * const msg) {
|
||||
if (msg)
|
||||
|
|
|
@ -98,7 +98,7 @@ void onMediaRemoved() {
|
|||
}
|
||||
}
|
||||
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {
|
||||
void onPlayTone(const uint16_t, const uint16_t/*=0*/) {
|
||||
rts.sendData(StartSoundSet, SoundAddr);
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ namespace ExtUI {
|
|||
void onMediaInserted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
void onPlayTone(const uint16_t, const uint16_t) {}
|
||||
void onPlayTone(const uint16_t, const uint16_t/*=0*/) {}
|
||||
void onFilamentRunout(const extruder_t extruder) {}
|
||||
void onUserConfirmRequired(const char * const) {}
|
||||
void onHomingStart() {}
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace ExtUI {
|
|||
void onMediaInserted() {}
|
||||
void onMediaError() {}
|
||||
void onMediaRemoved() {}
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration) {}
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {}
|
||||
void onPrintTimerStarted() {}
|
||||
void onPrintTimerPaused() {}
|
||||
void onPrintTimerStopped() {}
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "../marlinui.h"
|
||||
#include "../../gcode/gcode.h"
|
||||
|
||||
|
@ -460,7 +461,7 @@ namespace ExtUI {
|
|||
void onMediaInserted();
|
||||
void onMediaError();
|
||||
void onMediaRemoved();
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration);
|
||||
void onPlayTone(const uint16_t frequency, const uint16_t duration=0);
|
||||
void onPrinterKilled(FSTR_P const error, FSTR_P const component);
|
||||
void onSurviveInKilled();
|
||||
void onPrintTimerStarted();
|
||||
|
|
Loading…
Reference in a new issue