Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ New:
- Receive game controllers, by cable or wireless, through SDL 2 (optional at build time; not yet on Windows): Preferences > Controls > Game controllers lists those connected and shows the last button pressed or stick pushed, and `--list-gamepads` writes them in the terminal, without a window, to check a controller before a show. A controller that SDL does not know can be described in `gamecontrollerdb.txt`, in the folder of the data of MapMap. Linking their buttons and sticks to settings comes in a later version.
- Control the playback of a video file alone: go to a moment with `/mapmap/source/seek ,if <id> <seconds>`, move forward or back with `/mapmap/source/skip`, by id or by name pattern; mute it without losing its volume (`muted`, saved in the project); pause it alone with the Play switch of the inspector, which a key or a MIDI pad can learn, or with its setting `playing`. A paused video shows the image at the moment it was sent to, and a seek received before the video is loaded is done once it is. The inspector shows the duration of a video; the MCP tool `get_source` gives its `position` and `duration` in seconds, `set_property` seeks, and the new tool `skip_source` moves forward or back (#457, #512).
- A source paused alone by OSC (`/mapmap/source/pause`) stays paused when the whole project plays again or a layer is shown.
- Place up to eight cues in a video file and jump to them with a key or a MIDI pad: the Cues group of the inspector of a video has one row per cue, with its colour, its name, its moment, and the buttons Go, Set and Clear, which a key or a pad can learn. Go jumps to the exact image of the cue and plays the video, even when paused; on an empty cue, it places the cue where the video plays. A bar shows the cues and where the video plays, and the status bar says which cue was reached or placed. The cues belong to the file: every source reading it has the same, and the project keeps them under `media`. OSC and MCP reach them at `cues/<number>/go`, `set`, `clear`, `time`, `name` and `color`.
- Place up to eight cues in a video file and jump to them with a key or a MIDI pad: the Cues tab of the bottom section shows the cues of the video chosen as a list, one row per cue with its colour, its name, its moment, and the buttons Go, Set and Clear, which a key or a pad can learn, and as a grid of eight pads, which a click plays and a right click renames, colours, sets or clears; the cue reached stands out in both, and a cue is gray until it is coloured. Go jumps to the exact image of the cue and plays the video, even when paused; on an empty cue, it places the cue where the video plays. A bar shows the cues and where the video plays, and the status bar says which cue was reached or placed. The cues belong to the file: every source reading it has the same, and the project keeps them under `media`. OSC and MCP reach them at `cues/<number>/go`, `set`, `clear`, `time`, `name` and `color`.
- Put an effect on a source, which changes all its shapes, or on a layer, which changes only its shape. The first effect, Color Adjustment, sets the brightness, the contrast, the saturation and the hue. Effects are ISF shaders that read an image; the same file serves both places. An effect shows as a row under its source or its layer, with an eye to turn it on or off and a cross to remove it; a right-click on a source or a layer adds or replaces its effect, Delete removes the selected one, and selecting it shows its settings in the inspector. The eye of an effect and the rows of its page can be linked to a key or a MIDI control, like the other settings. Effects are also put and set through the MCP tools `list_effect_types`, `add_effect` and `remove_effect`, by OSC and links at the path `effect/<id>/<setting>`, and kept in the project. See `docs/extensions/isf.md`.
- A hidden layer, or an effect turned off, keeps a faint eye in the lists, to show where to click to turn it on again.
- Control every setting of a source or a layer by OSC at an address that follows its path: `/mapmap/layer/<id>/<path>`, for example `/mapmap/layer/3/output/vertices/5`. The new MCP tool `list_settings` gives the settings of a source or a layer with their type, bounds and options, and `set_property` takes a path.
Expand All @@ -45,6 +45,7 @@ New:
Improvements:

- The settings panel shows values in pixels without their unit, and numbers without thousands separators: 1024, not 1,024 px.
- A bottom section under the editor, hidden at first, holds tabs; Window > Editor, Bottom Section, and Editor and Bottom Section (Ctrl+Alt+1, 2 and 3; Cmd+Option on macOS), two buttons beside its tabs and the OSC address `/mapmap/view/panels` show one, the other or both, and MapMap remembers the choice.
- The frames per second in the status bar keep the same width as they change: the other boxes of the status bar no longer move each second.
- Turning the mouse wheel over a menu of the settings panel scrolls the panel instead of changing the value.
- A new shape opens the settings panel on the Media tab, the settings of its source.
Expand Down
8 changes: 5 additions & 3 deletions docs/informations/learning.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ The MIDI controls keep acting when Edit > Learned Keys Active is off: only the k

## Cues of a video: jump with a pad

A video file has eight cues: moments to jump to, during a show, with a key or a pad. They are in the "Cues" group of the inspector of a video, one row per cue: its number on its colour, its name, its moment, and three buttons. A click on the colour changes it.
A video file has eight cues: moments to jump to, during a show, with a key or a pad. They are in the "Cues" tab of the bottom section of the window, under the editor; choose a video in the Library, or a layer that shows one. The section is hidden at first: Window > Bottom Section (Cmd+Option+2 on macOS, Ctrl+Alt+2 elsewhere) shows it alone, and Window > Editor and Bottom Section (Cmd+Option+3, Ctrl+Alt+3) under the editor; Window > Editor (Cmd+Option+1, Ctrl+Alt+1) hides it. The two buttons at the right of its tabs hide or show the editor, and hide the section.

The tab shows the cues as a list, as a grid of eight pads, or both: the buttons List and Grid choose. In the list, a row per cue: its number on its colour, its name, its moment, and three buttons; a click on the colour changes it. A cue has the same gray until it is coloured. When the section is narrow, the moment goes first, then Set and Clear; the number and the name stay. In the grid, a pad per cue, with its number and its name: a click does what Go does, and a right click renames it, colours it, sets it or clears it. The cue the video last reached is outlined in the grid and lit in the list.

- **Go** jumps to the cue and plays the video from there, even when it was paused. On an empty cue, it places the cue where the video plays: during a rehearsal, press the pad at the right moment, and the cue is there.
- **Set** places the cue where the video plays, or moves it there.
- **Clear** removes it.

Learn a key or a pad on Go, as on any control: while learning, click Go in the row of the cue. A pad then places the cue the first time and jumps to it after. One can also type the moment, in seconds, in the row.
Learn a key or a pad on Go, as on any control: while learning, click Go in the row of the cue, in the list. A pad then places the cue the first time and jumps to it after. One can also type the moment, in seconds, in the row.

A thin bar above the rows shows the length of the video, a mark of its colour for each cue, and a white line where the video plays. The status bar says which cue was reached, "Cue 3 — Explosion", or placed, "Cue 3 set at 00:12.48".
A thin bar above the list and the grid shows the length of the video, a mark of its colour for each cue, and a white line where the video plays. The status bar says which cue was reached, "Cue 3 — Explosion", or placed, "Cue 3 set at 00:12.48".

The cues belong to the file, not to the source: two sources reading the same file have the same cues, and a source that reads another file shows the cues of that one. They are saved in the project.

Expand Down
4 changes: 4 additions & 0 deletions docs/informations/osc.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ Place the output window: `/mapmap/output/window ,iiii <x> <y> <width> <height>`

The names and numbers of the screens are those that `mapmap --list-screens` writes. Covering the screen of MapMap does not ask first, so that an installation with a single screen starts on its own. The place of the window is in the coordinates of the desktop: it applies at once when the output is in a window, else the next time it is.

## Main window

Show the editor alone, the bottom section alone (such as the cues of a video), or both: `/mapmap/view/panels ,s <editor|bottom|both>`

## Security

OSC has no authentication. By default MapMap listens on the loopback
Expand Down
2 changes: 1 addition & 1 deletion docs/project-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ A project may have a `media` array: what belongs to a media file rather than to
```

- `uri` is the path of the file, written as the `uri` of a source (see "Media paths"): relative to the project when the file is in its directory. Two sources reading the same file share its cues, and a source that reads another file shows the cues of that one.
- `number` is from 1 to 8, `time` the moment in seconds from the start of the file. `name` and `color` are written only when the user gave them; a cue without a colour has the one of its number: red, orange, yellow, green, cyan, blue, violet and pink.
- `number` is from 1 to 8, `time` the moment in seconds from the start of the file. `name` and `color` are written only when the user gave them; a cue without a colour is gray.
- The reader skips an entry without `uri`, a cue whose number is out of range or given twice, and a cue without a time or with a negative one, with a warning naming it. It keeps the keys it does not know, in an entry and in a cue, and writes them back. A cue beyond the end of its video is kept: a jump to it stops at the end.

The settings of a cue are in its video source, at `cues/<number>/<setting>`, as in OSC and MCP: `time` (empty while the cue is not placed; writing it places the cue), `name`, `color`, and the buttons `go` (jumps to the cue and plays this video; places the cue where the video plays when it is empty), `set` (places or moves it there) and `clear`. They are not written with the source.
Expand Down
17 changes: 17 additions & 0 deletions src/control/OscAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,20 @@ OscAction parseOutput(const QStringList& sub, const QVariantList& args)
return invalid("unknown output command: " + sub.join('/'));
}

// Parses /mapmap/view/panels: sub is what follows "view".
OscAction parseView(const QStringList& sub, const QVariantList& args)
{
if (sub.size() != 1 || sub.first() != QLatin1String("panels"))
return invalid("unknown view command: " + sub.join('/'));
OscAction a;
if (args.isEmpty())
return invalid("view panels needs editor, bottom or both");
if (!panelsShownFromName(args.at(0).toString(), &a.panelsShown))
return invalid("view panels needs editor, bottom or both, not: " + args.at(0).toString());
a.type = OscAction::ViewSetPanels;
return a;
}

} // namespace

OscAction parseOscAction(const QString& address, const QVariantList& args)
Expand Down Expand Up @@ -343,6 +357,9 @@ OscAction parseOscAction(const QString& address, const QVariantList& args)
if (head == QLatin1String("output"))
return parseOutput(rest.mid(1), args);

if (head == QLatin1String("view"))
return parseView(rest.mid(1), args);

return invalid("unknown command: " + address);
}

Expand Down
7 changes: 7 additions & 0 deletions src/control/OscAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QVariantList>

#include "OutputScreen.h"
#include "PanelsShown.h"

namespace mmp {

Expand Down Expand Up @@ -68,6 +69,9 @@ struct OscAction {
OutputSetMode, ///< Hide the output, show it in a window, or cover a screen.
OutputSetScreen, ///< Choose the output screen, by name or by number from 1 (selector).
OutputSetWindow, ///< Place the ordinary output window.

// The main window.
ViewSetPanels, ///< Show the editor, the bottom section, or both.
};

/// Direction of a LayerFlip.
Expand Down Expand Up @@ -113,6 +117,9 @@ struct OscAction {
OutputMode outputMode = OutputMode::Hidden;
QRect windowGeometry; ///< In the coordinates of the desktop.

// --- Payload for ViewSetPanels. ---
PanelsShown panelsShown = PanelsShown::Editor;

// Human-readable reason, set when type == Invalid (for verbose logging / tests).
QString error;

Expand Down
3 changes: 3 additions & 0 deletions src/control/OscInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ bool OscInterface::applyAction(MainWindow &main_window, const OscAction& action)
case OscAction::OutputSetMode:
main_window.setOutputMode(action.outputMode);
return true;
case OscAction::ViewSetPanels:
main_window.setPanelsShown(action.panelsShown);
return true;
case OscAction::OutputSetScreen:
{
const bool found = action.selectByName ? main_window.setOutputScreenByName(action.name)
Expand Down
17 changes: 5 additions & 12 deletions src/core/MediaCues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@ namespace mmp {
namespace {

/// The colours of the cues that have none of their own, from cue 1 to cue 8.
const QColor DEFAULT_COLORS[MediaCues::CUE_COUNT] = {
QColor(0xe5, 0x39, 0x35), // red
QColor(0xfb, 0x8c, 0x00), // orange
QColor(0xfd, 0xd8, 0x35), // yellow
QColor(0x43, 0xa0, 0x47), // green
QColor(0x00, 0xac, 0xc1), // cyan
QColor(0x1e, 0x88, 0xe5), // blue
QColor(0x8e, 0x24, 0xaa), // violet
QColor(0xd8, 0x1b, 0x60), // pink
};
/// The colour of a cue the user did not colour: a gray lighter than the buttons of MapMap,
/// under a number in white.
const QColor DEFAULT_COLOR(0x7a, 0x7d, 0x89);

/// The keys of a cue that this version reads.
const char* const CUE_KEYS[] = { ProjectLabels::NUMBER, ProjectLabels::TIME, ProjectLabels::NAME,
Expand Down Expand Up @@ -82,9 +75,9 @@ bool MediaCues::isValidNumber(int number)
return number >= 1 && number <= CUE_COUNT;
}

QColor MediaCues::defaultColor(int number)
QColor MediaCues::defaultColor()
{
return isValidNumber(number) ? DEFAULT_COLORS[number - 1] : QColor(Qt::white);
return DEFAULT_COLOR;
}

QString MediaCues::displayName(const Cue& cue, int number)
Expand Down
7 changes: 3 additions & 4 deletions src/core/MediaCues.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct Cue {
double time = 0.0;
/// The name given by the user; empty when none was given.
QString name;
/// The colour; invalid for the colour of its number (see MediaCues::defaultColor()).
/// The colour; invalid for the gray of a cue not coloured (see MediaCues::defaultColor()).
QColor color;
/// The keys of the project file this version does not know, written back as they were.
QJsonObject unknownKeys;
Expand All @@ -64,9 +64,8 @@ class MediaCues : public QObject {
/// Returns true for a number from 1 to CUE_COUNT.
static bool isValidNumber(int number);

/// Returns the colour of a cue that has none of its own: red, orange, yellow, green, cyan,
/// blue, violet and pink, in the order of DJ controllers.
static QColor defaultColor(int number);
/// Returns the colour of a cue that has none of its own: one gray for every cue.
static QColor defaultColor();

/// Returns the text naming a cue: its name, or "Cue <number>" when it has none.
static QString displayName(const Cue& cue, int number);
Expand Down
7 changes: 4 additions & 3 deletions src/core/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,8 @@ void Video::_addPlaybackSettings()
void Video::_addCueSettings()
{
SettingGroup* cues = settings()->addGroup(ProjectLabels::CUES);
cues->setPanelTitle(tr("Cues"), false);
// Shown in the bottom section of the window, not with the other settings of the video.
cues->setHiddenFromPanel(true);
for (int number = 1; number <= MediaCues::CUE_COUNT; ++number)
{
SettingGroup* group = cues->addGroup(QString::number(number));
Expand All @@ -562,13 +563,13 @@ void Video::_addCueSettings()

// Kept in the cues of the project, by file, not with the source.
group->addSetting(SettingInfo::color(ProjectLabels::COLOR, tr("Colour"))
.defaultValue(MediaCues::defaultColor(number))
.defaultValue(MediaCues::defaultColor())
.notStored()
.displayRow(QLatin1String(CUE_ROW))
.description(tr("The colour of the cue.")))
->bind([this, number]() {
const QColor color = _cues->cue(_uri, number).color;
return QVariant(color.isValid() ? color : MediaCues::defaultColor(number));
return QVariant(color.isValid() ? color : MediaCues::defaultColor());
},
[this, number](const QVariant& value) {
return _cues->setColor(_uri, number, value.value<QColor>());
Expand Down
117 changes: 117 additions & 0 deletions src/gui/BottomPanel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* BottomPanel.cpp
*
* (c) 2026 MapMap contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "BottomPanel.h"

#include <QHBoxLayout>
#include <QStackedWidget>
#include <QTabBar>
#include <QToolButton>
#include <QVBoxLayout>

namespace mmp {

namespace {

/// Margins around the tabs and the pages, in pixels.
const int PANEL_MARGIN = 4;

/// Space between the tabs and the page, in pixels.
const int PANEL_SPACING = 2;

/// Text of the button that hides the editor: an arrow up, the section grows to the top.
const QString HIDE_EDITOR_TEXT = QStringLiteral("⤒"); // ⤒

/// Text of the button that shows the editor again: an arrow down.
const QString SHOW_EDITOR_TEXT = QStringLiteral("⤓"); // ⤓

/// Text of the button that hides the section: a cross.
const QString HIDE_SECTION_TEXT = QStringLiteral("✕"); // ✕

} // namespace

BottomPanel::BottomPanel(QWidget* parent)
: QWidget(parent),
_tabs(new QTabBar(this)),
_pages(new QStackedWidget(this)),
_editorButton(new QToolButton(this)),
_hideButton(new QToolButton(this))
{
setObjectName(QStringLiteral("bottomPanel"));

_tabs->setExpanding(false);
_tabs->setDrawBase(false);
connect(_tabs, &QTabBar::currentChanged, _pages, &QStackedWidget::setCurrentIndex);

_editorButton->setAutoRaise(true);
_editorButton->setCheckable(true);
connect(_editorButton, &QToolButton::toggled, this, [this](bool hidden) {
setEditorShown(!hidden);
emit editorHiddenRequested(hidden);
});
setEditorShown(true);

_hideButton->setAutoRaise(true);
_hideButton->setText(HIDE_SECTION_TEXT);
_hideButton->setToolTip(tr("Hide this section"));
_hideButton->setAccessibleName(tr("Hide this section"));
connect(_hideButton, &QToolButton::clicked, this, &BottomPanel::hideRequested);

QHBoxLayout* header = new QHBoxLayout;
header->setContentsMargins(0, 0, 0, 0);
header->addWidget(_tabs);
header->addStretch(1);
header->addWidget(_editorButton);
header->addWidget(_hideButton);

QVBoxLayout* layout = new QVBoxLayout(this);
layout->setContentsMargins(PANEL_MARGIN, PANEL_MARGIN, PANEL_MARGIN, PANEL_MARGIN);
layout->setSpacing(PANEL_SPACING);
layout->addLayout(header);
layout->addWidget(_pages, 1);
}

int BottomPanel::addPage(const QString& title, QWidget* page)
{
_pages->addWidget(page);
return _tabs->addTab(title);
}

int BottomPanel::count() const
{
return _tabs->count();
}

QWidget* BottomPanel::currentPage() const
{
return _pages->currentWidget();
}

void BottomPanel::setEditorShown(bool shown)
{
const QString text = shown ? tr("Hide the editor above") : tr("Show the editor above");
_editorButton->blockSignals(true);
_editorButton->setChecked(!shown);
_editorButton->blockSignals(false);
_editorButton->setText(shown ? HIDE_EDITOR_TEXT : SHOW_EDITOR_TEXT);
_editorButton->setToolTip(text);
_editorButton->setAccessibleName(text);
}

} // namespace mmp
Loading
Loading