Added clip creation support 🎬 (#2271)
You can create clips with `/clip` command, `Alt+X` keybind or `Create a clip` option in split header's context menu. This requires a new authentication scope so re-authentication will be required to use it. Co-authored-by: Leon Richardt <leon.richardt@gmail.com> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -359,7 +359,10 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
});
|
||||
#endif
|
||||
|
||||
if (dynamic_cast<TwitchChannel *>(this->split_->getChannel().get()))
|
||||
auto *twitchChannel =
|
||||
dynamic_cast<TwitchChannel *>(this->split_->getChannel().get());
|
||||
|
||||
if (twitchChannel)
|
||||
{
|
||||
menu->addAction(OPEN_IN_BROWSER, this->split_, &Split::openInBrowser);
|
||||
#ifndef USEWEBENGINE
|
||||
@@ -375,6 +378,18 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
&Split::openWithCustomScheme);
|
||||
}
|
||||
|
||||
auto clipButton = menu->addAction(
|
||||
"Create a clip", this->split_,
|
||||
[twitchChannel] {
|
||||
twitchChannel->createClip();
|
||||
},
|
||||
QKeySequence("Alt+X"));
|
||||
clipButton->setVisible(this->split_->getChannel()->isLive());
|
||||
this->managedConnect(
|
||||
twitchChannel->liveStatusChanged, [this, clipButton] {
|
||||
clipButton->setVisible(this->split_->getChannel()->isLive());
|
||||
});
|
||||
|
||||
if (this->split_->getChannel()->hasModRights())
|
||||
{
|
||||
menu->addAction(OPEN_MOD_VIEW_IN_BROWSER, this->split_,
|
||||
@@ -398,7 +413,7 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
QKeySequence("Ctrl+F5"));
|
||||
}
|
||||
|
||||
if (dynamic_cast<TwitchChannel *>(this->split_->getChannel().get()))
|
||||
if (twitchChannel)
|
||||
{
|
||||
menu->addAction("Reload channel emotes", this,
|
||||
SLOT(reloadChannelEmotes()), QKeySequence("F5"));
|
||||
@@ -442,7 +457,7 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
moreMenu->addAction(action);
|
||||
}
|
||||
|
||||
if (dynamic_cast<TwitchChannel *>(this->split_->getChannel().get()))
|
||||
if (twitchChannel)
|
||||
{
|
||||
moreMenu->addAction("Show viewer list", this->split_,
|
||||
&Split::showViewerList);
|
||||
@@ -465,7 +480,7 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
moreMenu->addAction(action);
|
||||
}
|
||||
|
||||
if (dynamic_cast<TwitchChannel *>(this->split_->getChannel().get()))
|
||||
if (twitchChannel)
|
||||
{
|
||||
auto action = new QAction(this);
|
||||
action->setText("Mute highlight sound");
|
||||
|
||||
Reference in New Issue
Block a user