Contextual toolbars with SWS

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(Understanding context hierarchy)
(Special cases: item stretch markers and take envelopes)
Line 74: Line 74:
It is true that take envelopes and stretch markers belong to items, but putting all of them under item would mean we would have to repeat all of them for each item subgroup (put all take envelopes under ''Audio item'' and then again under ''MIDI item'' etc...). Since contexts count is high as it is, it would only clutter the interface.
It is true that take envelopes and stretch markers belong to items, but putting all of them under item would mean we would have to repeat all of them for each item subgroup (put all take envelopes under ''Audio item'' and then again under ''MIDI item'' etc...). Since contexts count is high as it is, it would only clutter the interface.
-
However, sometimes you want to have one toolbar for ''Audio item'' and one toolbar for ''MIDI item'' without differentiating if mouse is over take envelope or stretch markers. That's the reason these 2 contexts have a 4th state called '''Follow item context'''.
+
However, sometimes you want to have one toolbar for ''Audio item'' and one toolbar for ''MIDI item'' without differentiating if mouse is over take envelope or item itself. That's the reason these 2 contexts have a 4th state called '''Follow item context'''.
Setting any of these contexts to ''Follow item context'' will effectively ignore them and treat them as the item to which they belong.
Setting any of these contexts to ''Follow item context'' will effectively ignore them and treat them as the item to which they belong.
-
 
=== Using actions to load toolbars ===
=== Using actions to load toolbars ===

Revision as of 11:53, 26 October 2014

Contents

About

This is a documentation on SWS features regarding contextual toolbars. You need to have SWS extension installed, version 2.4.0.11 or later. You can get it here.
All coding by Breeder.


Basic concepts

Feature relies heavily on existing REAPER toolbars. The basic concept is fairly simple. User assigns different REAPER toolbars to different contexts (things like TCP, item, piano roll, etc...) and loads them under mouse cursor by calling a single action. The action will then load an appropriate toolbar for a thing under the mouse cursor.

Contextual toolbars example.gif

There are multiple advantages to this kind of workflow:

  • There is only one shortcut to remember
  • Since toolbar is loaded under mouse cursor, user doesn't have to do a lot of mouse movement
  • High number of contexts allows for a smaller toolbars, making toolbar buttons easier to find and click


Setting up

Contextual toolbars dialog


To open contextual toolbars dialog, either run the action SWS/BR: Contextual toolbars... or go to Main menu > Extensions > Contextual toolbars...

Contextual toolbars dialog.png

Dialog is divided into 3 parts:

  • Preset selector at the top. There are 8 presets. Each preset is tied to corresponding SWS action that will load toolbars based on how things are set up here for each preset
  • Contexts list view on the left. Here we set which toolbar is loaded for each context. Simply select an entry and right click it to set corresponding toolbar for it
  • Various options on the right. These are executed on toolbar load


Understanding context hierarchy


There are multiple context groups, separated by an empty space. They are:

  • Transport
  • Ruler
  • Track control panel
  • Mixer control panel
  • Arrange
  • MIDI editor
  • Inline MIDI editor


To explain how these work, we'll have a look at Track control panel group:
Contextual toolbars tcp contexts.png

Top entry, Track control panel represents the whole TCP, including track panels, envelope panels and empty TCP space. It functions as the parent for it's 3 subgroups:

  • Empty
  • Track panel
  • Envelope panel


Each subgroup can be set to 3 different states. For example, Envelope panel can be set up in the following way:

  • Do nothing - if mouse is over Envelope panel nothing will happen, even if Track control panel has a toolbar assigned to it
  • Inherit parent - Envelope panel will follow whatever is set up under Track control panel (naturally, the highest parent (in this case Track control panel) cannot be set up to inherit parent since it has none)
  • Override it's parent by setting up a corresponding toolbar for it - Envelope panel will load one toolbar, and it's parent Track control panel the other


This hierarchy repeats every time a group get's divided into subgroups, For example, Envelope panel is the parent of Volume envelope, Pan envelope etc...

Understanding options


Options are divided into multiple groups in regards to context groups. The only exception is the first group All which is valid for all contexts. All other groups are tied to specific main group of contexts. TCP is relevant only for Track control panel, MCP for Mixer control panel etc...
Each option has a check box to turn it on, and optionally a dropdown menu with various entries.

All groups should be self explanatory, but first one All might need some explanation:

  • Focus window under mouse allow you to focus window under mouse cursor. If you call the appropriate SWS action from MIDI editor, but mouse cursor is over item, arrange will get focused.
  • Keep toolbar always on top is actually an indirect fix for this bug. It is recommended you turn it on.


Special cases: item stretch markers and take envelopes


If you look at the group Arrange, you will notice that these two contexts are sharing the same level as Item:

  • Item stretch markers
  • Take envelope

It is true that take envelopes and stretch markers belong to items, but putting all of them under item would mean we would have to repeat all of them for each item subgroup (put all take envelopes under Audio item and then again under MIDI item etc...). Since contexts count is high as it is, it would only clutter the interface.

However, sometimes you want to have one toolbar for Audio item and one toolbar for MIDI item without differentiating if mouse is over take envelope or item itself. That's the reason these 2 contexts have a 4th state called Follow item context.

Setting any of these contexts to Follow item context will effectively ignore them and treat them as the item to which they belong.

Using actions to load toolbars


Once the arbitrary preset has been set up, it is enough to search the action list for SWS/BR: Exclusive toggle contextual toolbar under mouse cursor actions, find the action tied to the preset you previously set up and assign a shortcut to it. Note that actions are available in all sections of the Action list.

Actions work as toggle switches. If any of the toolbars set up in Contextual toolbars dialog is visible, all of them will get closed - otherwise toolbar corresponding to context under mouse cursor will get loaded.

In case you want multiple toolbars for the same contexts, it is recommended to set up multiple presets and then assign them to different shortcuts. For example, item toolbar for setting volume, fades etc...can be set to shortcut C and item toolbar for rendering/gluing etc... can be set to shortcut Ctrl+C.

Personal tools