\chapter{Editing}%
\label{cha:editing}

Editing comprises both time and track space.  The timeline consists
of the time certain media appear on the track going left to right
and a set of tracks from the top to the bottom.  There are 2 methods
of timeline editing -- drag and drop editing \index{drag and drop}, also called
\textit{arrow mode} \index{arrow}, and cut and paste editing \index{cut and paste} or \textit{I-beam
  mode} \index{i-beam}.  Cut and Paste is the default editing mode.  An additional,
but not often considered editing method is called \textit{two-screen
  editing} \index{two-screen} (or 3 point editing) where the Viewer is used to view media and then the
desired clip from the media is transferred to the timeline.

The timeline \index{timeline} is where all editing decisions are made
(figure~\ref{fig:timeline}).  This is a stack of tracks in the
center of the main window.  It can be scrolled up, down, left and
right with the scrollbars on the right and bottom.  It can also be
scrolled up and down with a mouse wheel, or left and right while
holding down the Ctrl key and using the mouse wheel.

\begin{figure}[htpb]
  \centering
  \includegraphics[width=1.0\linewidth]{timeline.png}
  \caption{Timeline editing session}
  \label{fig:timeline}
\end{figure}

The active region \index{active region} is the range of time which is affected by editing
commands on the timeline.  The active region is determined first by
the presence of in/out points \index{in/out point} on the timeline.
%
If those do not exist the highlighted region \index{highlighted region} is used. To reiterate,
\emph{highlighting} is done in \emph{cut and paste mode} by moving
the insertion point with the mouse in the timeline to where you want
to start. Then hold down the LMB\@, drag the mouse to where you want
the end point to be and release the LMB\@. In \emph{drag and drop
  mode}, the method to create a highlighted selection is to hold
down the Ctrl key and double click with the LMB with the mouse over
that column.

If no highlighted region exists, the insertion point \index{insertion point} is used as the
start of the active region.  Some commands treat all the space to
the right of the insertion point as active while others treat the
active length as 0 (zero) if no end point for the active region is
defined.

Most importantly, editing decisions never affect source material
meaning that it is non-destructive editing.  So not only does your
original media stay completely untouched, it is much faster than if
you had to copy all the media affected by an edit.  Editing only
affects pointers to source material, so if you want to have a new
modified media file at the end of your editing session which
represents the editing decisions, you need to render it.  Saving and
loading your edit decisions is explained in the Load, Save and the
EDL \index{EDL} section and rendering is explained in the section on Rendering.

In the following editing sections, references to common operations
are scattered within any of the modes where they seem pertinent.
However, many of the editing operations work in different modes.


\section{The Patchbay}%
\label{sec:patchbay}
\index{patchbay}

On the left of the timeline is a region known as the patchbay.  The
patchbay enables features specific to each track as described next.


\begin{description}
\item[Textbox] for naming the track.  The default names will usually
  be Video \#, Audio \#, or Mixer \# if using the multi-camera/mixer
  operations.  A \# will be designated for subsequent tracks as in 1,
  2, 3 and so on.
\item[Expander] which is a down arrow on the right side, is for
  viewing more options on the patchbay and for viewing the effects
  represented on the track.  You can just click on the expander to
  expand or collapse the patchbay and the track.  If it is pointing
  sideways, the track is collapsed.  If it is pointing down, the track
  is expanded.  Existing effects appear below the media for the track.
\end{description}

Below the textbox name are several toggles referred to as
\textit{attributes} for different features (currently there are 7 as
shown in figure~\ref{fig:patchbay01}).  If the toggle button is
shadowed by a color, the feature is enabled. If the toggle is the
background color of most of the window, it is disabled. Click on the
toggle to enable/disable the feature.

\begin{wrapfigure}[13]{O}{0.3\linewidth}
  %\vspace{-2ex}
  \centering
  \includegraphics[width=0.79\linewidth]{patchbay01.png}
  \caption{Patchbay}
  \label{fig:patchbay01}
\end{wrapfigure}

Several mouse operations speed up the configuration of several
tracks at a time. Click on an attribute and drag the cursor across
adjacent tracks to copy the same attribute to those tracks.  Hold
down Shift while clicking a track's attribute to enable the
attribute in the current track and toggle the attribute in all the
other tracks. Or you can:

\begin{enumerate}
\item hold down Shift while clicking an attribute,
\item click until all the tracks except the selected one are
  disabled,
\item then drag the cursor over the adjacent track to enable the
  attribute in the adjacent track.
\end{enumerate}

The 7 \textit{attributes} are described here next followed by the other available feature icons and their description.

\begin{description}
\item[Play Track] \index{play track} determines whether the track is rendered or
  not. If it is off, the track is not rendered.  For example if you
  turn it off in all the video tracks, the rendered media file will
  have only audio tracks.  If the track is chained to any other tracks
  by a shared track effect, the other tracks perform all the effects
  in this shared track, regardless of play status of the shared track
  that in this particular case affects the media output but not fade
  and effects.
\item[Arm Track] \index{arm track} determines whether the track is armed or not.
  Only the armed tracks are affected by editing operations. Make sure
  you have enough armed destination tracks when you paste or splice
  material or some tracks in the material will get left out.  In
  addition to restricting editing operations, the armed tracks in
  combination with the active region determine where material is
  inserted when loading files.  If the files are loaded with one of
  the insertion strategies which do not delete the existing project,
  the armed tracks will be used as destination tracks.  Note that disarming
  a track does not prevent you from dragging or attaching an Effect/Plugin
  onto a disarmed track - this is not considered an edit in this case.
\end{description}

\begin{description}
\item[Draw Media] determines if picons \index{picons} or waveforms \index{waveform} are drawn on
  the asset in the track.  You may want to disable this if you know
  that the media/format takes a long time to draw on the timeline.  By
  default it is set to on in order to see picons on the timeline.
\item[Don’t send to output] \index{mute} -- more commonly called
  \textit{mute} -- causes the output to be thrown away once the track is
  completely rendered. This happens whether or not \textit{Play track}
  is on.  For example if you mute all the video tracks, the rendered
  media file will have a blank video track.  Mute track is represented
  on the timeline with a line that has the default color of a
  pinkish-orange.  Use the pulldown \texttt{View $\rightarrow$ Mute} to
  have the line displayed.  It is a keyframable attribute, but Mute
  track keyframing is a toggle and it has only the two values of on or
  off. If a track is part of a shared track effect, the output of the
  track with the shared track effect is overlaid on the final output
  even though it is routed back to another track (the shared track).
  Mute track is used to keep the track with the shared track effect
  from overlapping the output of the source track (the shared track)
  where the shared track effect is not present.
\item[Gang Fader] \index{gang fader} cause the fader to track the movement of
  whatever other fader you are adjusting by dragging either the fader
  or the curve on the track.  It doesn't affect the editing made with
  menu controls.  A fader is only ganged if the arm track is also on.
  This is often used to adjust audio levels on all the tracks
  simultaneously.  Gang also causes Nudge parameters to synchronize
  across all the ganged tracks.
\item[Master Track] Mark a track as \textit{master} serves when using \textit{Gang Channels} or \textit{Gang Media} mode. See \nameref{sub:displaying_tracks_ganged}
\item[Track Data Height] \index{track!height} this up/down toggle symbol to the immediate right
of the 5 attributes, is used to individually resize each track.  This makes
it very easy to temporarily expand or contract the size of that track either
by clickin with the left mouse button or using the middle wheel up/down.
\item[Fader slider] \index{fader slider} fade values are represented on the timeline
  with a pink (default color) curve that is keyframable.  All tracks have a fader, but
  the units of each fader depend on whether it is audio or video.
  Audio fade values are in dB. They represent relative levels, where 0
  is the unaltered original sound level, -40 is silence, -80 the
  minimum value set by default.  You can move fader and keyframes down
  to -80 but the parameter's curve won't go below -40.  For your
  convenience you can set a different fade range with the curve zoom.
  Audio fader’s main purpose is to \textit{fade out} sound or to lower
  the sound level smoothly to silence, or \textit{fade in} to make
  sounds appear gradually instead of suddenly.  Video fade values are
  the percentage of opacity of the image in normal overlay mode, the
  percentage of the layer that is mixed into the render pipeline in
  the other overlay modes.  Click and drag the fader to fade the track
  in and out.  If it is ganged to other tracks of the same media type,
  with the arm option enabled, the other faders should follow.  Hold
  down the Shift key and drag a fader to center it on the original
  source value (0 for audio, 100 for video).
\item[Mixer] \index{mixers!toggle} in the expanded patchbay for that track designates
  the multi-camera mixer mode.
\item[Overlay mode] \index{overlay pulldown} in the expanded patchbay is used for
  porter-duff operations and is full explained in
  \nameref{cha:overlays} chapter.
\item[Nudge] \index{nudge} is in the expanded patchbay.  The nudge value is
  the amount the track is shifted left or right during playback. The
  track is not displayed shifted on the timeline, but it is shifted
  when it is played back. This is useful for synchronizing audio with
  video, creating fake stereo, or compensating for an effect which
  shifts time, all without altering any edits
  (figure~\ref{fig:overlay}).

  \begin{figure}[htpb] \centering
    \includegraphics[width=0.65\linewidth]{overlay.png}
    \caption{Video Overlay, audio Pan and Nudge.}
    \label{fig:overlay}
  \end{figure}

  Enter the amount of time to shift to instantly shift the
  track. Negative numbers make the track play later. Positive numbers
  make the track play sooner. The nudge units are either seconds or
  the native units for the track (frames or samples). Select the units
  by right clicking on the nudge textbox and using the context
  sensitive menu. Nudge settings are ganged with the Gang faders
  toggle and the Arm track toggle. Use the mouse wheel over the nudge
  textbox to increment and decrement the value.
\item[Pan] \index{panning box} is available in the expanded patchbay for audio
  tracks via a panning box. Position the pointer in the panning box
  and click/drag to reposition the audio output among the speaker
  arrangement. The loudness of each speaker is printed on the relative
  icon during the dragging operation. The panning box uses a special
  algorithm to try to allow audio to be focused through one speaker or
  branched between the nearest speakers when more than 2 speakers are
  used.
\end{description}

Press the Tab key while the cursor is anywhere over a track to
toggle the track arming status. Press Shift-Tab while the cursor is
over a track to toggle the arming status of every other track.

\paragraph{Automatic audio mappings} \index{audio!map} Several convenience functions
are provided for automatically setting the panning to several common
standards. They are listed in the Audio menu. These functions only
affect armed audio tracks. They are:

\begin{description}
\item[Audio~$\rightarrow$~Map 1:1] \index{audio!map 1:1} This maps every track to
  its own channel and wraps around when all the channels are
  allocated. It is most useful for making 2 tracks with 2 channels map
  to stereo and for making 6 tracks with 6 channels map to a 6 channel
  sound card.
\item[Audio~$\rightarrow$~Map 5.1:2] \index{audio!map 5.1:2} This maps 6 tracks to 2
  channels. The project should have 2 channels when using this
  function. Go to \texttt{Settings $\rightarrow$ Format} to set the
  output channels to 2. This is most useful for down-mixing 5.1 audio
  to stereo (for more information refer to Configuration, Settings and
  Preferences section~\ref{sub:audio_out_section}).
\end{description}

\paragraph{Standard audio mappings} Although \CGG{} lets you map any
audio track to any speaker, there are standard mappings you should
use to ensure the media can be played back elsewhere. Also, most
audio encoders require the audio tracks to be mapped to standard
speaker numbers or they will not work.

In the channel position widget, the channels are numbered to
correspond to the output tracks they are rendered to. For stereo,
the source of channel 1 needs to be the left track and the source of
channel 2 needs to be the right track.  For 5.1 surround sound, the
sources of the 6 channels need to be in the order of center, front
left, front right, back left, back right, low frequency effects. If
the right tracks are not mapped to the right speakers, most audio
encoders will not encode the right information if they encode
anything at all. The low frequency effects track specifically can
not store high frequencies in most cases.


\section{Manipulating Tracks}%
\label{sec:manipulating_tracks}
\index{track!pulldown}

Tracks in \CGG{} either contain audio or video.  There is no special
designation for tracks other than the type of media they contain.
When you create a new project, it contains three default tracks: one
video track and two audio tracks.  You can still add and delete
tracks from the menus.  The Tracks menu contains a number of options
for dealing with multiple tracks simultaneously.  Each track itself
has a popup menu which affects one track.

Operations in the \textbf{Tracks pulldown} affect only tracks which
are armed.

\begin{description}
\item[Move tracks up | Move tracks down] shift all the armed
  tracks up or down the stack.
\item[Roll tracks up | Roll tracks down] wheel motion of the tracks up or down.
\item[Delete tracks] deletes the armed tracks.
\item[Delete first track] deletes the first track, whether it is armed or not.
\item[Delete last track] deletes the last track, whether it is
  armed or not.
\item[Concatenate tracks] operation copies all the assets of
  every disarmed but playable track and concatenates it by pasting
  those assets at the end of the first set of armed tracks. They are
  pasted one after the other, keeping the same order they have on the
  stack. If there are two armed tracks followed by two disarmed
  tracks, the concatenate operation copies the assets of the two
  disarmed tracks and pastes them after the assets of the two armed
  tracks. If there are three disarmed tracks instead, the assets of
  two tracks are pasted after the assets of the armed tracks and the
  assets of the third track are pasted at the end of the first armed
  track. The destination track wraps around until all the disarmed
  tracks are concatenated. Disarmed tracks that are not playable are
  not concatenated.
\item[Align timecodes] see \nameref{sub:align_timecodes}
\item[Append to project] allows for creating new tracks after
  any existing tracks.
\item[Add subttl] will add a track for subtitles at the top of
  the other tracks.
\end{description}

The \textbf{Audio} \index{audio!pulldowns} and \textbf{Video pulldowns} \index{video!pulldown} each contain an
option to add a track of their specific type. In the case of audio,
the new track is put on the bottom of the timeline and the output
channel of the audio track is incremented by one. In the case of
video, the new track is put on the top of the timeline. This way,
video has a natural compositing order. New video tracks are overlaid
on top of old tracks.

\subsection{Displaying tracks: Ganged mode}%
\label{sub:displaying_tracks_ganged}
\index{track!ganged mode}

Often users working on media where Audio is the main focus, want all of a media's audio channels, whether stereo or 5:1 channels, to be treated as a single unit. They are more familiar with working with a DAW (Digital Audio Workstation software) and find that it takes extra work and a lot more care to have to individually manage audio tracks rather than have them automatically edited as a ganged group.

To get this capability, there is a \textit{Gang Tracks} \index{gang tracks toggle} toggle button on the main timeline controls to switch between 3 modes of working with multiple channels so that the tracks are automatically edited as a single unit. Operations affected include edits such as cuts, moving sections, and adding plugins. In addition to letting you work on the tracks of a group as one, you also get a saving of space on the timeline that makes it easier to view and edit the tracks. Group masters are marked by the \textit{Master Track} \index{master track} toggle in the patchbays \index{patchbay}. A track gang group begins on a master track, and extends to, but not including, the next master track. The 3 \textit{Gang Tracks} modes are:

\begin{enumerate}
	\item \textbf{Gang None:} this is the default mode and is the traditional way Cinelerra operates. If you never toggle the "Gang Tracks" button, everything operates normally as it always has. In this mode, the button icon looks like 3 tracks with $\dots$ on the end and all tracks are visible on the timeline. See figure~\ref{fig:gang-track-01}

\begin{figure}[htpb]
	\centering
	\includegraphics[width=0.99\linewidth]{gang-track-01.png}
	\caption{Gang None: only the video track is master. We see all tracks both master and non-master (default)}
	\label{fig:gang-track-01}
\end{figure}
	\item \textbf{Gang Channels:} in this mode, all \textit{Master Tracks} are shown. The exception is when there is no Master video, no Master audio or no Master subtitle track, in which case for each the first track of video, audio, and subtitle will be shown. For users who routinely switch the track order frequently, the patchbay has the \textit{Master Track} icon to set your own preference. Stereo tracks, or 5:1 channels/any number of audio tracks, are drawn as 1 audio track for the purpose of making changes on that single track which are propagated to all of its other channel tracks automatically. This is the DAW-like mode. The \textit{Gang Tracks} button icon looks like 2 tracks and only the first video and first audio tracks will be shown. See figure~\ref{fig:gang-track-02}

\begin{figure}[htpb]
	\centering
	\includegraphics[width=0.99\linewidth]{gang-track-02.png}
	\caption{Gang Channels: only the video track is master. Let's see the master tracks and the first of the non master tracks}
	\label{fig:gang-track-02}
\end{figure}

	\item \textbf{Gang Media:} this mode only shows the \textit{Master Tracks} of the media but changes are propagated to the appropriate other related tracks (even if they are not visible). The \textit{Gang Tracks} button icon looks like a single track. See figure~\ref{fig:gang-track-03}
\end{enumerate}

\begin{figure}[htpb]
	\centering
	\includegraphics[width=0.99\linewidth]{gang-track-03.png}
	\caption{Gang Media: only the video track is master. We only see the master tracks}
	\label{fig:gang-track-03}
\end{figure}

The current \textit{Gang Tracks} mode is saved across sessions and will be saved in your project. Although most likely users will work in the \textit{Gang None} mode, users more familiar with DAW software will tend to use the \textit{Gang Channel}s mode.

More details are described next about master tracks. Each patchbay has a \textit{Master Track} button on the right of the patchbay. These mark which tracks of the media are master tracks. The span of tracks between the gang group masters are the gang track group. The master track toggles can be disabled/enabled as the user wishes to create the desired track groups. Normal file loads will mark the first stream of each file loaded as a master, if the media is loaded with insertion strategy of\textit{ Replace current project}, \textit{Replace current project and concatenate tracks} or \textit{Append in new tracks}. Frequently, editing is done on video, audio, or audio/video groups to maintain timeline synchronization. By grouping related tracks, this procedure is much more automatic.

Previously existing projects created before the addition of ganged tracks, will have ALL tracks marked as master tracks and changing the \textit{Gang Tracks} button mode will have no effect. The user will have to properly designate which track is the master track and disabling the others in order to make use of the toggle modes.

There are no restrictions on how you use this feature and there may be variations for users not concerned about DAW-like workings that are very useful. Several methodologies are possible, but you have to know what you are doing.

NOTES:
\begin{itemize}
	\item When in \textit{Gang Channels} or \textit{Gang Media} mode, if the first audio track is not disarmed, but 	any of its connected channel tracks are, the disarm of those channels are ignored and all channels are treated as being armed. This is to be consistent with the purpose of using this mode; the purpose being that any edits to the first master track are automatically propagated to all other channels. \textit{Warning}: this behavior is contrary to the default of \CGG{} whereby an unarmed track never undergoes any alteration. This exception was made to mimic the behavior of DAWs, where the various channels of an audio track are combined into a single "line", and it makes no sense to talk about armed or unarmed channels.
	\item It may be better when using the \textit{Gang Channels} or \textit{Gang Media} mode to make any changes
	to the first audio channel to be automatically duplicated before reverting to the \textit{Gang None} mode to make other changes. Once you start changing individual channels (that is, audio tracks) so that they are no longer coordinated in their edits/plugins, it may be more difficult to switch back to \textit{Gang Channels} mode and get the desired results since the channels may no longer be lined up.
	\item Gang modes should not be used with Multi-camera/Mixers because they have very specific operational capabilities which are not compatible with the way that Ganging works.
	\item Gang flags in the patchbay specifically when in \textit{Gang Channels} or \textit{Gang Media} modes will operate as set in the Master Track. For example, if when in \textit{Gang Channels} mode, you turn off “Play track” on the visible audio track, none of the associated channels (i.e. the other stereo or other 5 channels) will play. And if in \textit{Gang Media} mode, if you turn on “Play track” for the Master Track, all associated video and audio tracks will play unless you turned off “Play track” for some of the associated audio/video slave tracks which will not play. 
	\item When adding a Plugin/Effect in \textit{Gang Channels} or \textit{Gang Media} mode to the track, highlighted selected region, or In/Out pointers area via dragging the plugin from the Resources Window the plugin will be added on the master and all slave tracks.  If using the Audio or Video pulldown, \textit{Attach Effect} option and you want to propagate the effect to all slave tracks, make sure that the checkbox for "Attach single standalone and share others" in the Dialog window is checked.  However, currently when using the right mouse button (RMB) on the master track to \textit{Attach effect}, the effect will only be inserted on that track.
\end{itemize}

\section{Two Screen Editing}%
\label{sec:two_screen_editing}
\index{two-screen}

This is a fast way to construct a program out of movie files (in
other programs is called \textit{three points editing}). The idea
consists of viewing a movie file in one window and viewing the
program in another window. Subsections of the movie file are defined
in the viewer window and transferred to the end of the program in
the program window.  Two screen editing can be done simply by using
keyboard shortcuts.  To get familiar with which keys to use, move
the mouse pointer over the transport panel and a tooltip appears,
showing what key is bound to that button.

To begin a two screen editing session, load your media resources by
using the main menu \textbf{File pulldown} and choose \textit{Load
  files}  \index{load media files}; make sure the insertion mode is set to \textit{Create new
  resources only}.  This insertion strategy \index{insertion strategy} is to ensure that the
timeline stays unchanged while new resources are brought in. Go to
the Resources window \index{resources window} and select the Media folder. The newly loaded
resources will appear. Double click on a resource or drag it from
the media side of the window over to the Viewer window \index{viewer!window}.

Check to make sure there are enough armed tracks on the timeline to
put the subsections of source material that you want.  Usually this
would be one video track and two audio tracks, but if there are not
enough, just create new tracks or arm more tracks.

Now to start your 2 screen editing, in the viewer window, define a
clip from the media file:

\begin{enumerate}
\item Set the starting point with the In pointer button.  You
  will see a left hand bracket on the timebar.
\item Move your cursor to the ending point of the clip you want
  to use.
\item Set the ending point with the Out pointer right hand
  bracket.
\item You will see a colored bar inside the brackets for easier
  viewing.
\item Drag the In/Out point \index{in/out point} with the mouse to conveniently
  change their position.
\end{enumerate}

These In/Out points define a clip \index{clip}.  You can now use this in a couple
of different ways.

\paragraph{Splice} \index{splice} The splice icon, or shortcut letter “\texttt{v}”,
inserts the selected area in the timeline after the insertion point.
After the splice has taken effect, the insertion point moves to the
end of the edit ready to be used as the next splice location. This
way you can continuously build up the program by splicing.  If an In
point or an Out point exists on the timeline the clip is inserted
after the In point or after the Out point. If both In and Out points
are set on the timeline, the clip is inserted after the In point. If
there are edits after your chosen splice location on the timeline,
they will be moved to the right.

\paragraph{Overwrite} \index{overwrite} The overwrite icon, or shortcut letter
“\texttt{b}”, overwrites the region of the timeline after the
insertion point with the clip. If an In point or an Out point exists
on the timeline the clip is overwritten after the In point or after
the Out point. If both In and Out points are set on the timeline,
the clip is inserted after the In point. If a region is highlighted
or both In and Out points exist they limit the region of the
overwriting and the clip may therefore be shortened. Here is a
detailed explanation to take advantage of this method.

To overwrite exactly on a precise region of the timeline:

\begin{enumerate} [noitemsep]
\item Arm only tracks to change.
\item Define the destination region on the timeline with [ and
  ], the In and Out points.
\item You can achieve maximum precision by setting the active
  region in the zoom panel.
\item Define the clip you want to use in the viewer with [ and
  ], the In and Out points.
\item Overwrite from Viewer to the timeline.
\end{enumerate}

If the destination region is shorter than the clip defined in the
viewer, the portion of the clip longer than the destination region
won't be inserted and on the timeline the following edits won't
move.  If the destination region is longer than the clip defined in
the viewer, the destination region will shrink and on the timeline
the following edits will move to the left.

\paragraph{Clip} The clip icon, or shortcut letter “\texttt{i}”,
generates a new clip for the resource window containing the affected
region but does not change the timeline.  Every clip has an
optional/default title and description.

\paragraph{Copy} The copy icon, or shortcut letter “\texttt{c}”,
copies the selection into the copy buffer.

\subsection{Use Case – Working with Sequences}
\label{sub:use_case_working_sequences}
\index{sequences}

\textit{From the Viewer to the Timeline \index{timeline} with the sequences imported
  in a Master Project.}

A convenient methodology for working on a Master project along with
1 or more previously saved Sub projects or \textit{sequences} use
case is described here.  A sequence is an edited assembly of audio
and video clips generally consisting of a series of videos that
relate to the same activity. This use case explains how to work this
way and some things you need to be aware of.

\begin{enumerate}
\item First load your Master project, which you worked on and
  saved earlier as an \texttt{.xml} file, using an Insertion strategy
  of \textit{Replace current project}.  Generally this Master project
  consists of media with any of the attributes of clips, autos,
  possibly keyframes, and effects.  You will see your project on the
  main timeline and the Media files that are part of this Master
  project will be displayed in the Resources window in the Media
  folder.
\item Previously you may have also saved a Sub project, which
  will now be referred to as a Sequence, as an \texttt{.xml} file that
  may contain any of the same such things: media, clips, autos,
  keyframes, effects.  Second you will want to load the Sequence using
  an Insertion strategy of \textit{Create new resources only}.  When
  you do the load, this Sequence will show as a file in the Resources
  window in the Clips folder.  The actual media will show in the Media
  folder.
\item Now Drag and Drop the Sub project from the Clips folder to
  the Viewer.
\item Set In and Out Pointers in the Viewer to the region of
  interest in the Sub project and in the Timeline of the Main window
  of your Master project, move the cursor position to where you would
  like to insert this In/Out section.
\item Click on the \textit{Splice (v)} button in the Viewer to
  insert this section into the Master project timeline.  All of the
  attributes of the selected Sub project section will now be inserted
  in the main timeline to include the autos, keyframes, effects, and
  labels.
\item Alternatively, if you click on the \textit{Overwrite (b)}
  button in the Viewer, you can see the Sub project In/Out section in
  the timeline, but without its autos, effects, keyframes, etc.  If in
  the timeline there were some autos, effects, and keyframes in that
  Master project, they will be in effect for the new section.
\end{enumerate}

You can see the advantages of using Splice versus Overwrite to
either insert (splice) with all of the attributes of a specific
section of your Sequence or to overwrite without the attributes to
allow for the smooth operation on the timeline by retaining the
timeline’s attributes at that point.

NOTE: for correct operation of this use case, you should have the
same (or more) number of tracks in the Master project as you do in
the Sequence.  To avoid having to know how many tracks you need, you
can use the Nest feature as described in the Nesting section
(\ref{sec:nesting_clips_and_assets}).


\section{Cut and Paste Editing}%
\label{sec:cut_paste_editing}
\index{cut and paste}

This is the more traditional method of editing in \CGG{} and
therefore is the default.  To enable the cut and paste editing mode
on the timeline, select the I-beam \index{i-beam} toggle on the control bar at the
top of the main program window. You can copy edits in the same
track, copy from different tracks in the same instance, start a
second instance of \CGG{} and copy from one instance to the other or
load a media file into the Viewer and copy from there.

To start editing, load some files onto the timeline.  Select a
region of the timeline by click dragging on it and select the cut
button to cut it. Move the insertion point to another point in the
timeline and select the paste button.  Assuming no In/Out points are
defined on the timeline this performs a cut and paste operation.

Most editing operations are listed in the \textit{Edit} pulldown \index{edit!pulldown}. Some of
them have a button on the program control toolbar as well as a
keyboard shortcut.  The keyboard shortcut is in parenthesis here.

\begin{description}
\item [Split | Cut] (x) Delete the selected area and put it in
  the cut buffer for future pasting.
\item[Copy] (c) Copy the selected area and put it in the cut
  buffer for future pasting.
\item[Paste] (v) Paste the material that is in the cut buffer.
\item[Clear] (Del) Clear the selected area. If the insertion
  point is over an edit boundary and the edits on each side of the
  edit boundary are the same resource, the edits are combined into one
  edit comprised by the resource. The start of this one edit is the
  start of the first edit and the end of this one edit is the end of
  the second edit. This either results in the edit expanding or
  shrinking.
\item[Paste silence] (Shift+Space) Paste blank audio/video for
  the length of the selected area. Following edits will be pushed to
  the right.
\item[Mute Region] (m) Overwrite blank audio/video on the
  selected area. Following edits don't move.
\item[Trim Selection] Delete everything but the selected region.
\item[Select All] (a) Select the whole timeline.
\end{description}

In Cut and Paste editing mode you can \textit{edit labels} \index{label} as
well. By enabling Edit labels in the \textbf{Settings pulldown}, or
by disabling the Lock labels from moving button on the Program
Control Tool Bar, labels will be cut, copied or pasted along with
the selected regions of the armed tracks.

Using labels and In/Out points are useful in editing audio.  You can
set In/Out points for the source region of the source waveform and
set labels for the destination region of the destination
waveform. Perform a cut, clear the In/Out points, select the region
between the labels, and perform a paste.

\paragraph{In / Out Points} \index{in/out point} The In and Out bracket placement is
explained here to illustrate their usage.  Because of the shape of
the markers [ and ] you may assume that they are inclusive -- that
everything placed in between would be included in the clip \index{clip}, such as
in the case of being transferred to the timeline from the Viewer.
In reality, one of the two markers will not include the frame that
was visible at the time the marker was affixed. Depending on whether
the \textit{Always show next frame} option is used or not, it is the
In or Out marker that will not be inclusive.

To obtain a clip on the timeline exactly as you saw in the Viewer,
you must necessarily move the In mark back from the beginning before
the first desired frame or move the Out mark forward after the last
desired frame, depending on the \textit{Always show next frame}
setting.

Some of the confusion can be attributed to the fact that the Viewer
shows frames, while the markers determine spaces, i.e.\ times, that
are not visible between frames. You have to think of each frame as
being delimited by two spaces -- one preceding and one following.
The In mark is always placed before the displayed frame and the Out
mark is always placed after the displayed frame, while taking into
account in its calculations whether the \textit{Always show next
  frame }option is used or not. If you just remember that the
reference of the markers is in the middle of the icon, you will
avoid confusion.

\paragraph{Overwrite} \index{overwrite} To perform overwriting within the timeline
paste on a selected region (highlighted or between In/Out
points). The selected region will be overwritten. If the clip pasted
from the clipboard is shorter than the selected region, the selected
region will be shrunk. Following edits will move. If the clip pasted
from the clipboard is longer than the selected region, the selected
region will be overwritten with the first part of the clip and the
remaining part of the clip will be written after the
overwriting. Following edits will move.

\paragraph{Tracks $\rightarrow$ Concatenate tracks} This operation
copies all the assets of every disarmed but playable track and
concatenates it by pasting those assets at the end of the first set
of armed tracks. They are pasted one after the other, keeping the
same order they have on the stack.

\paragraph{Split -- blade cut and hard edges:} \index{split} You can cut the
tracks into 2 pieces on the timeline by putting the hairline cursor
on the place you want to do a cut and then using the character “x”
or the scissors tool (figure~\ref{fig:cut}).

\begin{wrapfigure}[16]{O}{0.3\linewidth}
  \vspace{-2ex}
  \centering
  \includegraphics[width=0.9\linewidth]{cut.png}
  \caption{Blade cut}
  \label{fig:cut}
\end{wrapfigure}

A \textit{cut} uses a non-empty selection region, where the
\textit{blade cut} or \textit{split} has no duration in the
selection, just a hairline.  As usual the use of cut when a
selection is set, deletes/cuts the highlighted area.  In the case
where an In point or an Out point exists on the timeline, the clip
is split at the location of the In/Out point since it has priority
over the cursor location.  A blade cut simply splits the edit into
two edits.  In order to have the video and audio aligned, it works
best to have \texttt{Settings $\rightarrow$ Align cursor on
  frames} \index{align cursor on frames}.  When a blade cut occurs, the edges are created as
\textit{hard edges}. \index{hard edge} These are edges that cannot be deleted by
track optimizations \index{timeline!optimization}.
%
\CGG{} has built-in optimization on the timeline.  So that whenever
two parts on the timeline are sequential frames, it automatically
optimizes by making them into 1 item.  So if you are cutting,
dragging, editing, or whatever and somehow frame \# 40 ends up
right next to frame \# 41, it optimizes them together.  This
optimization affects many areas throughout the program code.  When
you do a blade cut/split, all armed tracks will be included in the
cut and green-colored triangles will show on the bottom of the
track on both the left and the right side of the cut.  This is a
\textit{hard edge} marker toggle, as opposed to the soft edge
designation for an ordinary edit.  The \textit{hard edge} marker
can be toggled off/on if so desired.  In order to not interfere
with the usual drag handles, only a few pixels are used for the
toggle so you have to be sure you have the cursor right over the
hard edge triangle -- when in position, it will be obvious because
you can see an arrow pointing to the corner.  Use Shift-left mouse
button 1 to toggle off/on the hard edge marker on all tracks
simultaneously.


\section{Drag and Drop Editing}%
\label{sec:drag_drop_editing}
\index{drag and drop}

To enable the drag and drop editing mode on the timeline, select the
arrow toggle \index{arrow} on the control bar at the top of the main program
window.  Drag and drop editing is a quick and simple way of working
in \CGG{}, using mostly only the mouse. The basic idea is to create
a bunch of clips \index{clip}, then drag them in order into the timeline, thus
building prototype media that you can watch in the compositor. If
after watching it, you wish to re-arrange your clips, set effects,
add transitions or insert/delete material, just drag and drop them
on the timeline.

To simply get started, perform the following operations which are
useful for working in a drag and drop editing session.  First load
your media by using the main menu \textit{File} pulldown \index{file pulldown} and choose
\textit{Load files} \index{load media files}; make sure the insertion mode is set to
\textit{Create new resources only} \index{insertion strategy}.  This loads the files into the
Resources window \index{resources window}.

\begin{enumerate}
\item Create some video and audio tracks on the timeline using
  the \textit{Video} \index{video!pulldown} and \textit{Audio} \index{audio!pulldown} pulldowns.
\item Open the Media folder in the Resources window.  Make sure
  the necessary tracks are armed and drag a media file from the
  Resources window to the timeline \index{timeline}. If the media has video, drag it
  onto a video track or if just audio, drag it onto an audio
  track. For a still image, drag it onto a video track.
\end{enumerate}

You can also drag multiple files from the Resources window. When
dropped in the timeline they are concatenated. If you have
\textit{Display Icons} selected in the Resources window, drawing a
box around the files selects contiguous files. If you have
\textit{Display Text} selected, Ctrl-clicking on media files selects
additional files one at a time; Shift-clicking on media files
extends the number of highlighted selections.  In addition to
dragging media files, if you create clips and open the clip folder
you can drag clips onto the timeline.

\CGG{} fills out the audio and video tracks below the dragging
cursor with data from the file. This affects what tracks you should
create initially and which track to drag the media onto. To drag and
drop a file on the Program window, you need to create on the
timeline the same set of tracks as your media file.

When you drag your chosen media from the media folder to the
timeline, your mouse pointer will drag a thumbnail and, once over
the timeline, the outline of a white rectangle, as big as the edit
you are going to have appears.  Drag the media to the desired
position of an empty track of the timeline and drop it.  If there
are other edits on that track, when you move the white outline over
an edit, you will see a bow tie symbol $\bowtie$ appearing at edit
boundaries. If you drop the media there, the new edit will start
from the edit boundary indicated by the center of the bow tie
$\bowtie$.

Since the mouse pointer is in the middle of the white outline, when
this rectangle is bigger than the visible part of the timeline, it
is quite cumbersome to precisely insert it for long
media. Lengthening the duration visible in the timeline by changing
the sample zoom in the zoom panel will reduce the size of the white
rectangle, making a precise insertion possible.

When you drag and drop edits within the timeline:

\begin{itemize}
\item If you drop an edit when bow ties $\bowtie$ are shown,
  that edit will be cut and pasted starting at the edit boundary
  indicated by the center of the bow tie $\bowtie$.  Following edits
  on the same track will move.
\item If you drop an edit when there are no bow ties $\bowtie$
  shown, the original edit will be muted and pasted where you dropped
  it. No edits will move. A silence will appear in place of the
  original edit.
\item If you have more armed tracks on the timeline than in the
  asset you are dragging, only the following edits of the tracks
  affected by the drag and drop operation will move to the right. This
  will cause loss of synchronization \index{sync}. To restore it, disarm the tracks
  affected by the drag and drop operation, highlight the just dropped
  edit and paste silence over it using the \textit{Edit} pulldown,
  \textit{Paste Silence}.
\end{itemize}

Labels sometimes work differently in Drag and Drop editing mode in
that you can't drag and drop them. They might be locked to the
timebar \index{timebar}, even with the Edit labels option enabled.  Although with
the Edit labels option enabled, if a selected area of a resource is
spliced from the Viewer to the timeline in a position before labels,
these labels will be pushed to the right for the length of the
selected area.

In/Out points can be used to perform Cut and Paste operations in
Drag and Drop mode as well as in Cut and Paste mode.  Use the \textit{Edit}
pulldown to view the list and their keyboard shortcuts.


\subsection{Copy/Paste Behavior}%
\label{sub:copy_paste_behavior}
\index{drag and drop!MMB options}

There are many options for moving, copying, pasting, inserting, and
deleting selected \textit{edits}, more commonly referred to by the
user as \textit{clips}, when in the Drag and Drop (arrow) editing
mode.  This makes it easier to avoid constantly having to disarm/arm
tracks.  To create a selection \index{edit!selection} move the cursor over the clip and
just click the left mouse button; remove a selection by left mouse
button click again.  This will mark your selection with a colored
border which contains some red.  The easiest way to initially use
the various modes is to click on the middle mouse button when your
cursor is over a track and a popup displays the modes and shortcuts.
However, for those users who prefer the addition of the Ctrl key to
add multiple selections as is commonly done for listbox operations,
there is a preference in \texttt{Settings $\rightarrow$ Preferences
  $\rightarrow$ Appearance} tab, called \textit{Clears before
  toggle} \index{clears before toggle} that changes the behavior.

When an edit is marked as selected, it can be cut/copied into the
paste clip buffer.  The constructed clip buffer will begin with the
leftmost edit and end with the rightmost edit.  The edits may
contain media, or be silence, or skipped if they are not selected.
The clip tracks are copied from the first track with an active edit
selection to the last track with an active edit selection.  A clip
track can be completely empty if no selection was made on the track.
The word \textit{packed} means that the silent edits and empty
tracks are not included in the copy to the clip buffer, and all of
the elements are packed together, no gaps.  Packing a clip buffer
makes it easier to move \textit{blobs} of data around.  Once the
edits have moved and have a relative relationship applied, an
unpacked clip buffer allows the media to be copied with the relative
positions of the edits preserved.

The \textit{edits} popup is activated on a track and a red and
yellow colored reticle appears to temporarily mark the location when
you click on the middle mouse button.  An expanded explanation is
provided below.

\renewcommand{\arraystretch}{1.15}
\begin{center}
  \begin{longtable}{p{0.3\textwidth-2\tabcolsep} p{0.7\textwidth-2\tabcolsep}}
    \toprule
    \textbf{Key} & \textbf{Operations}\\
    \midrule
    Drag & Hold down the Ctrl key while dragging to move a single
           edit elsewhere.\\
    Left mouse button & Selects and highlights the edit under the
                        cursor with a red selection box. Left mouse
                        button also will toggle that clip selection
                        off if it is on.\\
    \bottomrule
  \end{longtable}
\end{center}

\begin{center}
  \begin{longtable}{p{0.2\textwidth-2\tabcolsep}
    p{0.2\textwidth-2\tabcolsep} p{0.6\textwidth-2\tabcolsep}
    }
    \toprule
    \textbf{Popup Label} & \textbf{Key} & \textbf{Operation}\\ \midrule
    \endhead
    Clear Select & Ctrl-Shift-A & Deselect all selected edits --
                                  ones that have the red lines
                                  around them.\\
                                  
    Select Edits & Ctrl-Alt-' & Select all edits within a highlighted area of the timeline \\
    
    Deselect Edits & & Deselect all edits within a highlighted area of the timeline \\

    Copy & Ctrl-c & Copy the selected edits into the copy buffer.\\

    Cut & Ctrl-x & Delete the selected edits after copying them into
                   the buffer. The edits\\

    Mute & Ctrl-m & Delete the selected edits after copying them
                    into the buffer. The space previously occupied
                    by the edits will be replaced with silence.\\

    Copy Pack & Ctrl-Shift-C & Copy the selected edits into the
                               buffer and remove any silent
                               sections.\\

    Cut Pack & Ctrl-z & Delete the selected edits after copying them
                        into the buffer. The edits after the
                        election will move left to occupy the
                        vacated space.  The edits in the copy buffer
                        will be packed together within each track.\\

    Mute Pack & Ctrl-Shift-M & Delete the selected edits after
                               copying them into the buffer.  The
                               deleted edits will be replaced with
                               silence.  The edits in the copy
                               buffer will be packed together within
                               each track.\\

    Paste  & Ctrl-v & Paste contents of the copy buffer at the
                      insertion point marked by the red \& yellow
                      reticle of the popup menu or the position of
                      the hairline cursor. This is a splice
                      operation which creates space for the edits.\\

    Overwrite & Ctrl-b & Paste contents of the copy buffer at the
                         insertion point marked by the red \& yellow
                         reticle of the popup menu or the position
                         of the hairline cursor. This destroys the
                         current edits in that space.\\

    Overwrite plugins & Ctrl-Shift-P & Pastes plugins that are in the Copy
                               buffer to current location but no
                               clip. Plugins.\\
    \bottomrule
  \end{longtable}
\end{center}
\renewcommand{\arraystretch}{1}

The copy/paste behavior respects the armed/disarmed tracks
state.  A paste of audio on a video track will fail and vice versa.
In addition if you attempt to paste edits consisting of more tracks
than what is available at that location it will not allowed.

Attaching transitions to multiple selected edits via the \textit{Video} or
\textit{Audio} pulldowns is also available.  The new transitions are attached
at the start of the edits, and will replace any existing attached
transitions.  As a side note, when in drag and drop mode the end
transition does not drag.

\subsection{Snapping while Cutting and Dragging}%
\label{syb:snapping_cutting_dragging}
\index{snap}

\paragraph{Cutting/Snapping edits} \index{edit!cut with snap} cuts from an edit handle to the
insert point.  There are Edit Panel buttons which normally are used
to move to the previous or next edit handle/label.

\begin{wrapfigure}[3]{r}{0.2\linewidth}
	\vspace{-2ex}
	\centering
	\includegraphics[width=0.7\linewidth]{snap.png}
\end{wrapfigure}

They look like tags and the letter E on the menu bar and are
oriented forward/backward.  These same buttons can be used to
\textit{cut} from the insert pointer to the previous or next
edit/label when the ctrl+alt keys are both pressed when the buttons
are used.  They \textit{snap} off the media instead of doing the
standard re-positioning.  This is useful to minimize the number of
operations necessary to cut between edits/labels.

Instead of using the edit panel buttons, you can more easily use the
following keyboard shortcuts to perform the same functions:

\begin{center}
	\begin{tabular}{lll}
		\toprule
		snap\_right\_edit & ctrl+alt+ '.' &\\
		snap\_left\_edit & ctrl+alt+ ',' &\\
		snap\_right\_label & ctrl+alt +shift '.' & shift+period is the > sign on US keyboards\\
		snap\_left\_label &  ctrl+alt +shift',' & shift+comma is the < sign on US keyboards\\
		\bottomrule
	\end{tabular}
\end{center}

\paragraph{Drag Snapping} \index{edit!drag with snap} if you hold down the Ctrl + Alt keys while
dragging using the mouse, once the clip gets near to an edit, a
label, an in/out pointer or the start/end of the timeline, the
dragged clip will snap next to that marker.  The 2 will now be
exactly aligned with no gap and no overlap.  As you drag the clip
close to one of the markers, when they are within a short distance
they start to stick and stay that way until you move further away
from that distance.  Also, the line will turn color from green to
yellow while in the sticky phase.  In addition, this works for a
plugin while dragging so that it will be the same length as the edit.

\subsection{Copy/Paste clips/medias across Multiple Instances}%
\label{sub:copy_paste_multiple_instances}
\index{multiple instances: copy/paste}

It is easy to copy/paste clips/media within a single instance of
\CGG{} or across multiple instances.  The reason this works is
because there are hidden X cut buffers and these are used to
transmit EDL from 1 instance to another.

Steps to copy from a source timeline and paste to a target timeline:

\begin{enumerate}
	\item highlight a selection on the timeline in 1 instance of \CGG{}
	\item use the Copy icon (shortcut c) on the main menu bar to copy
	into a buffer
	\item move the pointer to another instance of \CGG{} and set an
	insertion point in its timeline
	\item use the Paste icon (shortcut v) to paste the clip to that
	other instance selection target
\end{enumerate}

\subsection{Grouping edits}%
\label{sub:grouping_edits}
\index{edit!grouping}

\CGG{} recognizes as a group, the edits of different armed tracks
that have aligned beginnings, regardless of whether they have the
same source or aligned ends.  You can drag these edits around on the
timeline to construct your movie by rearranging scenes. If more than
one track is armed, \CGG{} will drag any edits which start on the
same positions the edit the mouse pointer is currently over. Another
method of Grouping of edits is performed as follows:

\begin{enumerate}
\item Select \index{edit!selection} each of the clips you would like to be part of a
  group.
\item Use the desired Copy mode as described above to get into
  the buffer.
\item Go to the Resources window Clip folder and right click on
  an empty spot.
\item Choose the Paste Clip option.  Now you have a named clip
  of the current selection.
\end{enumerate} A more traditional Grouping of edits which make a
Permanent Group works as described next.  A temporary group is just
a set of selected clips and works the same as a single selection.
\begin{enumerate}
\item Create a group:
  \begin{itemize}[noitemsep]
  \item Select multiple clips/edits with left mouse button
    over the clip;
  \item Hold down shift and left mouse click over any of the
    selected clips to create a group;
  \item A Group Id and color are assigned to this group making
    it easy to distinguish.
  \end{itemize}
\item Move a group:
  \begin{itemize}[noitemsep]
  \item Move your cursor over any of the clips within the
    group; click to select the clip group.
  \item Click and Hold down the left mouse button to drag.
  \end{itemize}
\item Dissolve a permanent group:\\
  To ungroup select any of the group edits/clips and shift left
  mouse click to ungroup (same as creating).  The edits will be
  ungrouped, and the current selection will be replaced with the
  ungrouped clips.
\end{enumerate}

The color of the created groups are not muted and are assigned by
Group Id going sequentially through the number of 1 to 64.
Therefore if you dissolve a group and make it again, it will have a
different Group Id and a different color.

\subsection{Dragging Groups}%
\label{sub:dragging_groups}
\index{edit!dragging group}

Dragging while in \textit{Drop and Drag editing mode} (arrow mode)
is really easy.  Just select \index{edit!selection} the clip or clips you want to drag
using the left mouse button, then put your cursor over one of them
and drag while holding down the left mouse button.  Keyframes,
autos, labels, and plugins will also be dragged.  Dragging honors
armed/disarmed tracks.  When you drag there will be some possible
colors as defined; depends on how the edges of edits and groups
interact:

\begin{itemize}
\item Green color means OK to drop in that position as it will
  fit.
\item Yellow color means you can drop here and when you do it
  will be exactly next to that existing edit.
\item Blue color means it overlaps something and this includes
  overlapping itself.
\item Red color means can not drop here because it will not fit
  in the space.
\item Orange color means the track types do not match so it can
  not be dropped here.
\end{itemize}

Remember: With the \texttt{Shift} key on, it will always
\textit{overwrite}. Without the \texttt{Shift} key enabled, it
always \textit{inserts} only.

The original (older) method of dragging while in Arrow \index{arrow} mode, lets
you just left mouse click on a single clip or aligned clips and just
drag.  This older method of dragging does not move any of its
effects with it at this time.  There will only be a white outline
while dragging and it will let you drop only if it fits.  You can
also perform some dragging and grouping while in the \textit{Cut and
  Paste editing mode} (ibeam mode \index{i-beam}) by taking advantage of the Ctrl
button in conjunction with the left mouse button.

\begin{itemize}
\item Double click selects a column so you can move, for
  example, the audio and video together by holding down the Ctrl key
  and dragging.
\item A single clip can be dragged without any of its aligned
  clips, by holding down and Ctrl key and drag.
\end{itemize}

This last section on Dragging, outlines the difference
between \textit{column selection} \index{column selection} and \textit{marking selection} \index{marking selection}.
Column selection is available to make it easy to still be able to do
some dragging in I-beam mode whereas Marking selection makes it easy
to drag clips together that are not columnated.


\subsection{Selection Methods}%
\label{sub:selection_method}
\index{edit!selection}
\index{active region}

Concerning \textit{Selection} methods, the following information is
partially pertinent to all editing, but is most important to keep in
mind when using Drag and Drop Editing.

Originally, there was the column oriented timeline drag selection
which can be seen in 1 of 3 ways:

\begin{enumerate}
\item a highlighted vertical column
\item the colored line region between the [~in and out~] marker
  labels
\item a single flashing line
\end{enumerate}

The selection priority works like this. When the highlighted
vertical drag column is in use (1), it has the highest precedence
and is used as the selection.  When the column is a single line (2),
then the fall back selection is the [~in/out~] marker region, if
they are set.  When they are not set, and the cursor is flashing,
then the selection start=end and the selection is empty, but it does
have a position on the timeline which can be used for editing.  This
is input for the vertical style cut/paste drag/drop editing.

More recently, in addition to the column oriented timeline drag
selection, there is now \textit{group} \index{edit!grouping} capabilities which have
various \textit{edit} selections.  These are created in the Drag and
Drop editing mode by clicking edits to toggle
select/deselection.  These groups are input to a different (more
modern) set of cut, paste and overwrite drag/drop editing.  You
can see this set of operations when you click on an edit with the
middle mouse button, and are also available using the shortcuts
shown. They are more like text editor commands to include
\texttt{ctrl+x=cut}, \texttt{ctrl+c=copy}, \texttt{ctrl+v=paste},
and so on \dots The keyboard Delete key is not hooked to these
operations, and is hooked to the original editing methods.

In this \textit{group} mode, if there are In/Out \index{in/out point} markers set, they
enter the selection priority queue between the column selection and
the cursor only. You can see the In/Out markers selected region
colored line across the timebar (slightly underneath where the time,
samples or frames show ) on the main timeline extending between the
[ and ].  This means that when the highlighted cursor selection is
empty, the In/Out selection will be used.

Summarizing: to select multiple edits/clips on the timeline you can simply use LMB on each edit. Or, if in \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ appearence tab $\rightarrow$ Flags} we have enabled \textit{Clears before toggle}, use CTRL + LMB on each edit.

There is also a faster way:

\begin{enumerate}
	\item Arm the tracks you want to be used.
	\item Highlight the area as usually you do with \textit{I-beam} mode (or use \textit{In/Out Points}; or position \textit{Insert Point} over the stack of edits). If you miss an edit that you want included, the same method can be used to add it. It is an additive operation. And, it will include the partial edits in the selected area, thus making it easy to disinclude ones you do not want.
	It will include silence also but you can remove that or any other edit with CTRL + LMB.
	\item Press MMB on a clip inside the highlight area and the PopUp menu is shown with the \textit{Select edits} option on the top.
	\item Choose the \textit{Select or Deselect edits} option and the clips inside the highlight area will be selected or deselected.
\end{enumerate}

And there is a Drag mouse way (this requires that the cursor be on the first
clip and from there you start the drag):
\begin{enumerate}
	\item To Drag Select edits, hold down Alt+Left Mouse Button (LMB) and drag over the selection area. Releasing the mouse results in selecting. 
	\item To Drag Deselect edits. hold down Alt+Ctrl+LMB and drag over the area to be desected.  Releasing the mouse results in deselecting.
\end{enumerate}

If using certain operating systems (for example Ubuntu and Arch) that might field the Alt key before it gets to \CGG{}, you can use the following for both Select and Deselect instead:
\begin{enumerate}
	\item Press and hold down Ctrl+Alt+LMB on an edit
	\item Drag on the edits you want to select
	\item Release the Ctrl key
	\item Release the LMB
	\item Release the Alt key
\end{enumerate}

\section{Inter-View Mode -- Identifying Source Targets}%
\label{sec:inter-view_identifying_source_target}
\index{inter-view}

Inter-View mode provides a mapping of a particular media file to its
timeline \index{timeline} usages. It is somewhat similar to Two Screen Editing in
that you make use of the Viewer. It makes it possible to precisely
trace and indicate in the media the origin of a particular segment
of the timeline and visually indicate the use and distribution that
the timeline makes of a particular media.  A good example usage
would be in the case of a 30 minute interview where you use a few
short pieces to make a shorter 10 minute section, find out that you
have made the timeline 12 minutes instead and need to cut out
another 2 minutes. This feature provides the following capabilities:

\begin{itemize}
\item You can see on the timeline all of the places where a
  particular piece of media was used.
\item You can see which parts of that particular media are
  already used so you do not reuse that same piece again.
\end{itemize} Figure~\ref{fig:inter-view01} shows an example of the
Inter-View mode mapping preview mini-window.
\begin{figure}[ht]
  \includegraphics[width=0.8\linewidth]{inter-view01.png}
  \caption{Inter-View mode: white bar$\rightarrow$source; red
    bar$\rightarrow$timeline}
  \label{fig:inter-view01}
\end{figure}

There is a second usage of Inter-View mode that can be helpful if
some tracks have become misaligned, such as in the case of 2 audio
channels no longer being in sync.  You can use this mode to get them
back in alignment.

Explanation of how to use Inter-View mode will be described here
next.

\begin{itemize}
\item Do your editing as usual on the timeline until you are
  ready to see what is used or unused.
\item Make sure you are in any of the Preview modes \index{preview mode} in the
  Resources window \index{resources window}; you enable the mode using the pulldown to the left
  of the word \textit{Search}.  The option looks like this \quad
  \includegraphics[height=\baselineskip]{fullplay.png}.
\item Middle mouse click on a thumbnail in the Resources window and
  a popup occurs of that media with a white colored bar at the top
  and a red colored bar at the bottom with black sections.
\end{itemize}

The red/white bars represent the presence and the black sections
represent the absence of where that media is used on the timeline.
To get to a bigger representation, use the “\texttt{f}” key for a
full screen.  Now you can operate the following buttons to display
what you need to see and to move around.  It is important to note
that \textit{locked tracks} will not be represented.  This makes it
easy to ignore the audio track segments if you want so there is less
confusion in the display.

\begin{itemize}
\item Clicking on the top white or black spaces in the top time
  bar loads the Viewer with the source media, and sets the In/Out [
  and ] pointers to be the selection of that edit.
\item Click on a location in the bottom red or black bar, and
  the main cursor and composer will re-position to the corresponding
  location on the session timeline.
\item Dragging on the red/black bar will correspondingly update
  the position in the timeline and composer.
\item Ctrl-click on the bottom bar and the timeline and composer
  are re-positioned to the beginning of that edit.
\item Shift-click on the bottom bar and a \textit{selection} is
  made of that section in the timeline and the compqoser is updated
  with that start position.
\end{itemize}

%\pagebreak
Figure~\ref{fig:inter-view02} displays Inter-View window and its
relation to the timeline, viewer, and compositor.
\begin{figure}[ht]
  \centering
  \includegraphics[width=1.0\linewidth]{inter-view02.png}
  \caption{Inter-View mode and the timeline}
  \label{fig:inter-view02}
\end{figure}

The Inter-View mode works for Media, Proxy, and User Bins.  When the
preview window has only black bars on the top and bottom, it means
that this particular media is not loaded in the timeline.  So when
you are in Proxy, meaning that the Proxy files are loaded on the
timeline, there will be only black bars for the corresponding Media
file UNLESS there is an audio track associated with the video.
Because audio tracks are not proxied, they will show for Media but
not for Proxy.

\section{Edit Tools}%
\label{sec:edit-tools}
\index{edit tools}

\subsection{Edit Length}%
\label{sub:edit-lenght}
\index{edit!length}

To set the length of an edit in the timeline, select the region
which contains the edit to be modified. Now select the menu bar
\texttt{Edit $\rightarrow$ Edit Length}\dots menu item to activate
the \textit{edit length} popup (figure~\ref{fig:lenght}).  The
duration of the edit can be reset by entering the desired edit
length in seconds.  Pressing OK will change all of the selected
edits (in armed tracks) to the specified length.

\begin{figure}[htpb]
    \centering
    \includegraphics[width=0.5\linewidth]{lenght.png}
    \caption{Edit Length window}
    \label{fig:lenght}
\end{figure}

\subsection{Align Edits}%
\label{sub:align_edits}
\index{align edits}

When loading media, a common problem is that the various audio/video
tracks do not always have exactly the same lengths. For example, you
might load audio/video recordings from your camera and be dismayed
to see that the audio for each segment is a half second longer than
the video. If you load a large set of media clips by concatenation,
the audio and video will be more skewed as more media is
loaded. Align Edits makes it possible to adjust the edits so the
audio and/or video align by adjusting
the edits so that the track lengths are consistent. To use this
feature, load all of the desired media and select a region which
contains all of the edits to be aligned in the timeline. Now select
the menu bar \texttt{Edit $\rightarrow$ Align Edits} menu item to
operate the change. The topmost armed track is used as a template
reference, and the rest of the tracks are either cut or padded to
align the edit boundaries.  Besides aligning audio with the video,
you can also align video with the audio if the first armed track is
audio. The code performs the following algorithm:

\begin{itemize}
\item Use the first armed track as the master track (it must
  contain data).
\item Collect the \textit{edit project start times} on the
  selected master track. Only edits that are 100\% inside the selected
  area will be used.
\item Set all other tracks to match the \textit{edit times} of
  the template track, either by putting in silence or cutting the
  region to align the edits on the \textit{edit times} of the master
  track.
\end{itemize}

The start time sequence of media and silence edits
along the master track are collected as the target alignment
boundaries. All armed tracks after the master track are modified so
that if the next edit edge is too soon, it adds silence; if it is
too late, edits are shortened or deleted past the point of the next
target alignment boundary time.  Align Edits works best if there are
an equal number of Video and Audio sections.  Also, it is better to
use cuts instead of adding silence -- if there are silence edits
together, the algorithm will combine the silence edits into a single
edit and results may not be as desired.

The first two screenshots in figure~\ref{fig:align} show the Before,
the Highlighted Edits to be manipulated, and the After results for
the Align Edits. The third screenshot \textit{adds silence} in the
second section as noted in red letters.

\begin{figure}[htpb] \centering
  \includegraphics[width=1.0\linewidth]{align.png}
  \caption{Align edits}
  \label{fig:align}
\end{figure}


\subsection{Reverse Edits}%
\label{sub:reverse_edits}
\index{reverse edits}

The Reverse Edits can be useful to change the order of 2 edits in
the case where you would like to put a \textit{teaser} section that
occurred in the middle of a movie at the beginning instead, that is,
reversed positions.  To operate, highlight completely the edit areas
you would like reversed and then use the pulldown \texttt{Edit
  $\rightarrow$ Reverse Edits}.

Figure~\ref{fig:reverse01} shows the selected / highlighted area to
which Edits will be applied.  Note the first edit is 0002, followed
by 0003, 0004, and 0005 in that order.

\begin{figure}[htpb]
  \centering
  \includegraphics[width=0.9\linewidth]{reverse01.png}
  \caption{Selected area for Reverse Edits}
  \label{fig:reverse01}
\end{figure}

Figure~\ref{fig:reverse02} shows the results of executing
\textit{Reverse Edits}.  Now you will see the reversed order of
0005, 0004, 0003, and last 0002.

\begin{figure}[htpb]
  \centering
  \includegraphics[width=0.9\linewidth]{reverse02.png}
  \caption{Results of the Reverse Edits}
  \label{fig:reverse02}
\end{figure}


\subsection{Shuffle Edits}%
\label{sub:shuffle_edits}
\index{shuffle edits}

The file pulldown \texttt{Edit $\rightarrow$ Shuffle Edits} will
randomly exchange the location of the edits.  This feature can be
used to change the order of the music like you would do from your
MP4 player where you have a playlist of your favorite music.  Or
perhaps you are creating an advertisement background, you can
randomly change it, thus the viewer sees a different order of scenes
each time shown.

Figure~\ref{fig:shuffle} illustrating Shuffle Edits of the
highlighted area of the first screenshot on the page.  Note the
permutation of the fragments resulting in 0002 now being first, then
0004, 0003, and 0005 last.

\begin{figure}[htpb]
  \centering
  \includegraphics[width=0.9\linewidth]{shuffle.png}
  \caption{Shuffle edits: the edits are permutated}
  \label{fig:shuffle}
\end{figure}

\section{Multi-Session}%
\label{sec:multi_session}
\index{multi-session}

You can run as many sessions of \CGG{} as your computer resources allow.  However, if you are using the same \texttt{\$HOME/.bcast5}, changes you make for one may impact the others. You can always create and rename a new \texttt{.bcast5} from:\\
\texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Interface $\rightarrow$ Index files:} and press \textit{Index files go here}

\section{Multi-Viewer Window Support}%
\label{sec:multi_viewer_window_support}
\index{multi-viewer window}

You can create as many Viewer windows as you want in \CGG{}.  These are handy for users who are adept at working with a lot of different clips simultaneously.  By bringing up multiple Viewer windows, each clip can be edited in its own area, making it easy to see all of the separate pieces.  After you have loaded some media files, to start another Viewer window, right click on one of the pieces of media in the Resources window.  This brings up a menu of several options, one of which is \textit{view in new window}.  Choose this option and that media will come up in a new Viewer window for you to work (figure~\ref{fig:multi-view01}).

\begin{figure}[htpb]
	\centering
	\includegraphics[width=1.0\linewidth]{multi-view01.png}
	\caption{Shown here are 3 Viewer windows and the \textit{View in new window} popup}
	\label{fig:multi-view01}
\end{figure}

\section[ShuttlePROv2 and ShuttleXpress Jog Wheels for Editing]{ShuttlePROv2 and ShuttleXpress Jog Wheels for Editing}%
\label{sec:shuttle_jog_wheels_editing}
\index{shuttle pro v2 and shuttlexpress}

The ShuttlePROv2 and ShuttleXpress are affordable jog wheels\protect\footnote{programmatic specifications from Eric Messick} which
can be useful for working with Cin, especially if you do a lot of
playing forward/backward, fast/slow/normal, and single frames
(figure~\ref{fig:shuttle}).
%
Directions for using the ShuttlePROv2 and the ShuttleXpress with
\CGG{} are described next. These devices work by sending keystrokes
used in Cin, corresponding to the shuttle action, to the keyboard
buffer. The shuttle has been fully integrated into the \CGG{} code
so that after the one initial setup, no further intervention is
required.  The multi-speed outer wheel works the same and has the
same number of S positions on both shuttles but the shuttle Xpress
has only 5 keys.  Since the majority of user operations will most
likely be with the use of the 2 wheels, the slightly smaller Xpress
could be a better choice with its 5 easy to reach keys.  The Pro is
approximately $4\times7$\,inches whereas the Xpress is about
$4\times4$\,inches.

\begin{figure}[htpb]
  \centering
  \includegraphics[width=0.9\linewidth]{shuttle.png}
  \caption{ShuttlePROv2 and ShuttleXpress}
  \label{fig:shuttle}
\end{figure}

The vendor supplied \textit{string} device names for the shuttles
are currently:

\texttt{/dev/input/by-id/usb-Contour\_Design\_ShuttlePRO\_v2-event-if00}\\
\texttt{/dev/input/by-id/usb-Contour\_Design\_ShuttleXpress-event-if00}\\
\texttt{/dev/input/by-id/usb-Contour\_Design\_ShuttlePro-event-if00}

Only 1 necessary initial setup is required due to permission
settings for non-root usage. As root, just copy a file that provides
the necessary permissions to use the shuttle, then reboot, Example
copy:

\begin{lstlisting}[style=sh]
sudo cp {cindat_path}/doc/99-ShuttlePRO.rules /etc/udev/rules.d/
\end{lstlisting}

then the next time after you reboot, the permissions should be
correct. This file only needs to contain one of the following lines
depending on which shuttle version you have/use, but all will be in
the file.

\begin{lstlisting}[style=sh]
# for  newer PRO model
ATTRS{name}=="Contour Design ShuttlePro" MODE="0644"
# for older PRO model
ATTRS{name}=="Contour Design ShuttlePRO v2" MODE="0644"
# for the Xpress model
ATTRS{name}=="Contour Design ShuttleXpress" MODE="0644"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0b33", ATTRS{idProduct}=="0020", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0b33", ATTRS{idProduct}=="0030", MODE="0666"
\end{lstlisting}

If you swap your shuttle, for example upgrade from an Xpress to a
PROv2, just stop Cin, unplug the original shuttle, plug in the
replacement shuttle, and restart Cin.  If you start the \CGG{}
program and the shuttle does not function as before, stop \CGG{} and
then simply unplug it and plug it in again.  There are a couple of
reasons why it may stop functioning.  One is because \CGG{} was not
stopped with the usual Quit command and the shuttle was improperly
shut down when there was a crash.  The other possibility is that a
static discharge occurred in the area.

A default shuttlerc file is automatically used when a shuttle device
is plugged in when Cin is started. This file sets up the key
bindings for \CGG{} to use. You can override any default settings by
having a local file in your \texttt{\$HOME} directory, named
\texttt{.shuttlerc} to reflect your personal preferences.


\subsection{How to Modify the Default Key Settings}%
\label{sub:modify_default_key_settings}

Detailed information on how to modify your local \texttt{.shuttlerc}
file is described next, but if you need help you can request more
information in the forum at {\small
  \url{https://cinelerra-gg.org}}. In the \texttt{shuttlerc} file, a
\# always represents a comment and blank lines are ignored.  The
first thing you must do is copy the system supplied
\texttt{shuttlerc} file to your \texttt{\$HOME} directory and rename
it as \texttt{.shuttlerc} (with a period).

The \texttt{shuttlerc} file has sections that in the case of \CGG{},
represent different windows allowing you to set the keys, K1-K15 for
the Pro and K5-K9 for the Xpress, the shuttle wheel positions of
S0/S1/S-1 for stop, S2 through S7 for wheeling to the right, and S-7
through S-2 for wheeling to the left for reverse.  Then there is JR
to jog right (clockwise) and JL to jog left (counter-clockwise) for
the inner smaller wheel for single frame movement.  See the key
arrangement on a later page for location of the keys for each of the
two different shuttles.

The sections are surrounded by brackets for windows such as \CGG{}
(the main window), Viewer, Composer, Resources, Load, and Default.
If you want the keys to be defined the same in every window, you can
bracket each window on lines one right after the other and then just
define one set of keys.  The other lines will have the key
name/shuttle position followed by its assigned value.  The values
you use for the keys are usually shortcuts and have to be
operationally defined within \CGG{}. For example, the shortcut “f”
to go fullscreen is defined so can be used; however the shortcut “h”
is not defined so will not do anything.  You can check the file,
shortcuts.html, for some options to use.

Next are a few actual examples from the default
\texttt{{cindat\_path}/shuttlerc} file.

The next brackets represent sections. Default, Resources, Load
windows all use the same key values.

\begin{lstlisting}[style=sh]
[Default]
[Resources]
[Load]
K5 XK_Home
K6 XK_Button_1 # same as mouse button 1
K7 XK_Button_2 # same operation as mouse button 2
K8 XK_Button_3
K9 XK_End
# for example, in the Load menu, use scroll up to get to the next file name
JL XK_Scroll_Up
JR XK_Scroll_Down
\end{lstlisting}

Cinelerra with brackets around it next, is the section with some key
definitions for the main window.

\begin{lstlisting}[style=sh]
[Cinelerra]

# Most useful functions have to be on K5-K9
# because Xpress only has 5 keys
K5 XK_Home      # Beginning
K6 XK_KP_6      # Reverse, or if playing Stop
K7 XK_KP_0      # Stop
K8 XK_KP_3      # Play, or if playing Stop
K9 XK_End       # End
...
S-7 REV_16     	# Next 6 are reverse keys
S-6 REV_8      	#  the number on the end represents speed
S-5 REV_4      	#  number can be decimal up to 64
S-4 REV_2      	#  2 means 2x or double speed
S-3 REV_1
S-2 REV_0.5    	#  0.5 represents 1/2 speed
S-1 XK_KP_0    	# Because the Shuttle does not generate S0,
		#   have to use S-1
S0  XK_KP_0   	# Hardware does not generate S0
S1  XK_KP_0   	# Because the Shuttle does not generate S0,
		#   have to use S1
S2  FWD_0.5
S3  FWD_1
...
\end{lstlisting}

An explanation for the above REV and FWD key symbol values is
necessary to facilitate user preferences.  Obviously REV stands for
reverse and FWD for forward.  You can set any speed up to and
including 64x (that is, 64 times the normal speed) on any of the S
keys.  First in the line is the key name such as S-3 and then the
key direction of FWD or REV followed by the symbol for underscore
(\_) and then the numerical value to use.  For example, if you want
the $5^{th}$ forward position, S5, to play 10$\frac{1}{2}$ times
faster, you would use the statement \texttt{S5 FWD\_10.5}.  Integer
or decimal numbers are legal.

For the Viewer, you may want keys defined to do a Splice or an
Overwrite so define differently.  Note that assignments that contain
single character letters must be enclosed in quotes.

\begin{lstlisting}[style=sh]
[Viewer]
# Splice - Viewer only; may be defined
# differently than Composer or Cinelerra
K2 "v"
K4 "b"		# Overwrite
\end{lstlisting}

To change any key value to an alternative value, just edit the file
and make the changes.  Besides just keys and alphabetic letters of
numbers, you can also use any \CGG{} value that contains the
combination with Shift, Alt, and Ctrl.  For keys that are not
printable characters, you can look up the symbol name to use for a
specific operation in the file called:
\texttt{/usr/include/X11/keysymdef.h}. Some examples:

\begin{lstlisting}[style=sh]
K10 Alt-XK_Left	  # Go to previous edit \\
K13 Ctrl-XK_Right # Go to next label
\end{lstlisting}

For sequences of one or more \textit{printable} characters, you can
just enclose them in double quotes.  For example in the
\texttt{[Composer]} section, to go into or out of fullscreen mode,
automatically start playing and put a label there, you could define
a key like this:  K7 “f~l” - that is printable character f, a space,
and printable character l.

After modifying \texttt{.shuttlerc}, the next time you use the
shuttle, your changes will automatically take affect without even
having to stop and restart Cin.  However, the first thing to try if
problems is to stop \CGG{}, unplug the shuttle, wait a few seconds,
plug it in again, and then restart cin.  If for some reason, the
shuttle keys still do not work after that, you may have an incorrect
setup and you will have to correct that first.  For example, if you
define S5 twice within the \CGG{} setup, it will fail.  It is
suggested that if you make changes, you should initially uncomment
DEBUG in the \texttt{.shuttlerc} file and start up \CGG{} from a
terminal window so that you can make sure it is working and has no
output errors.  An error might look like:

\begin{lstlisting}[style=sh]
dupl key name: [Cinelerra]K1
shuttle config err file: /root/.shuttlerc, line:37
\end{lstlisting}

Keep in mind when changing the values, that the ShuttleXpress has
fewer buttons so if you define K1 it will only work for the
ShuttlePro.

Any time you are having trouble with your shuttle, you can copy the
default \texttt{shuttlerc} file from
\texttt{{cindat\_path}/shuttlerc} to your local \texttt{.shuttlerc}
file, and edit that to\ switch to DEBUG mode by removing the \#
comment from the DEBUG line.  But you will have to have started Cin
from a terminal window to see the key values. The first time you use
the shuttle or after you change the file, the current assignments
will show in the terminal window so will look something like:

\begin{lstlisting}[style=sh]
[Cinelerra] # 1
K5[D]: XK_KP_0/U
K5[U]: XK_KP_0/U
\end{lstlisting}

When you are in DEBUG mode and are just working away, what you will
see is something like this:

\begin{lstlisting}[style=sh]
key: 0058 1
key: 0055 0
\end{lstlisting}

or:

\begin{lstlisting}[style=sh]
shuttle:  00 00 00 00 00
key: XK_Home 0
\end{lstlisting}

When you change the focus from one window to another, you will see
something like this:

\begin{lstlisting}[style=sh]
new focus: 04c00137
new translation: Viewer
key: 0059 1
\end{lstlisting}

You can also set an environment variable to temporarily use an
alternative shuttle configuration file for testing as in:

\begin{lstlisting}[style=sh]
export SHUTTLE_CONFIG_FILE=/tmp/shuttlerc_test
\end{lstlisting}

The shuttle wheel occasionally will not \textit{stop} after you have
wheeled it to play forward.  This is a documented known problem from
the original code so you just have to joggle it a little in the
other direction and then it will stop.  S0 does not always generate
a signal to do a stop and that is why S1 and S-1 have to be used to
relay the stop instead.  Also, if you have a fullscreen Composer or
Viewer up and the regular one also, the fullscreen takes precedence.


\subsection{Troubleshooting auxilliary information}%
\label{sub:troubleshooting_auxilliary_information}

In order to see if you hardware was recognized by the operating
system, key in:

\begin{lstlisting}[style=sh]
lsusb -v -d 0b33:0030  # for the Shuttle Pro or PROv2\\
lsusb -v -d 0b33:0020  # for the Shuttle Xpress
\end{lstlisting}

\paragraph{Note 1} Currently, the keys K14 and K15 do not function
on the \textit{Contour Design ShuttlePro} but do on the
\textit{Contour Design ShuttlePRO v2} due to a Report Descriptor
error.  You can workaround this by uncommenting \texttt{USB\_DIRECT}
in your local \texttt{.shuttlerc} file.  This directly uses libusb
rather than the generic Linux hid driver.  \texttt{USB\_DIRECT}
works for any of the currently tested shuttles.

\paragraph{Note 2} If you are not sure if your shuttle is fully
functional, you can verify that the hardware device has been seen by
your operating system with this procedure.
\begin{enumerate}
\item From a terminal window as an ordinary user key in: lsusb (the
  first character is a lower case L for list).  You will see
  something like the following depending on which usb device you
  have the ShuttlePro plugged into:
\begin{lstlisting}[style=sh]
Bus 003 Device 002: ID 0b33:0030 Contour Design, Inc. ShuttlePro v2
\end{lstlisting}
\item To make sure you have usbmon installed key in:
\begin{lstlisting}[style=sh]
sudo modprobe usbmon
\end{lstlisting}
\item Next key in the following:
\begin{lstlisting}[style=sh]
sudo od -tx1 /dev/usbmon3
\end{lstlisting}
  where the last 3 is the same \# as the Bus in above.  If it lists
  \texttt{Bus 002}, then use \texttt{/dev/usbmon2} instead.
\item Now with focus in that same terminal window, press any shuttle
  key just to see what happens and should see about 12 lines similar
  to these below -- a new set every time you press a single key or
  the wheel.  The lines are usually not important, just the fact
  that you get a response is.  However if you have multiple devices
  on the same bus, you will get responses from any and all of them.
  Attempt to isolate your shuttle by temporarily unplugging
  unnecessary devices on the same bus or plug the shuttle into a
  different usb port that has fewer devices.
    \begin{lstlisting}[style=sh]
0000000 80 70 99 75 53 8c ff ff 43 01 81 02 03 00 2d 00
0000020 4e 61 5c 5c 00 00 00 00 8d 2c 06 00 00 00 00 00
0000040 05 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00
0000060 01 ff 00 00 00 80 70 99 75 53 8c ff ff 53 01 81
0000100 02 03 00 2d 3c 4e 61 5c 5c 00 00 00 00 b1 2c 06
0000120 00 8d ff ff ff 05 00 00 00 00 00 00 00 00 00 00
0000140 00 00 00 00 00 80 70 99 75 53 8c ff ff 43 01 81
0000160 02 03 00 2d 00 4e 61 5c 5c 00 00 00 00 3d d7 09
0000200 00 00 00 00 00 05 00 00 00 05 00 00 00 00 00 00
0000220 00 00 00 00 00 00 ff 00 00 00 80 70 99 75 53 8c
0000240 ff ff 53 01 81 02 03 00 2d 3c 4e 61 5c 5c 00 00
0000260 00 00 64 d7 09 00 8d ff ff ff 05 00 00 00 00 00
\end{lstlisting}
\item Next press the key that you want to verify is functioning --
  if no new lines show up, then the key is non-functional so there
  is a hardware problem.  If you get output, then perhaps there is a
  problem with your software setup.
\item Use Ctrl-C on the terminal window when done to get back to the
  prompt.
\end{enumerate}

\paragraph{Note 3} Another method for testing to make sure your
model of the Shuttle does not have different key definitions than
the one that \CGG{} was coded for is to do the following.

\begin{enumerate}
\item Locate the shudmp.C program in your \CGG{} directory.
\item Compile that with the command:  \texttt{c++ shdmp.C -o shudmp}
\item Make the file executable with the command:  \texttt{chmod +x shudmp}
\item Execute:
\begin{lstlisting}[style=sh]
sudo ./shdmp /dev/input/by-id/usb-Contour\_Design\_ShuttlePro-event-if00 # substitute your shuttle
\end{lstlisting}
\end{enumerate}

Then press your shuttle key that is having problems and check the
results.  They should look like:

\begin{lstlisting}[style=sh,caption={Example for K7}]
event: (4, 4, 0x90007)  #The last number, 7, is the expected Key number.
event: (1, 262, 0x1)
event: (0, 0, 0x0)
event: (4, 4, 0x90007)
event: (1, 262, 0x0)
event: (0, 0, 0x0)
\end{lstlisting}

\begin{lstlisting}[style=sh,caption={Example for K15}]
Example for K15:
event: (4, 4, 0x9000f)  #The last number f is 15 in hexadecimal and is the expected Key.
event: (1, 270, 0x1)
event: (0, 0, 0x0)
event: (4, 4, 0x9000f)
event: (1, 270, 0x0)
event: (0, 0, 0x0)
\end{lstlisting}

When done, you will have to Ctrl-C to get out of the program.

\paragraph{Note 4} For developers, if you have a pre-UEFI Secure
Boot kernel it is also possible to do the following for further in
depth testing:

\begin{lstlisting}[style=sh]
ls /sys/kernel/debug/hid   \# to locate numerical value of the shuttle, e.g. 0003:0B33.0030.0006
cat "/sys/kernel/debug/hid/0003:0B33.0030.0006/rdesc"  # substitute your own numerical value
cat "/sys/kernel/debug/hid/0003:0B33.0030.0006/events"  # press keys to see the results
\end{lstlisting}
%\begin{enumerate}
    %\item \texttt{ls /sys/kernel/debug/hid   \# to locate numerical value of the shuttle, e.g. 0003:0B33.0030.0006}
    %\item \texttt{cat “/sys/kernel/debug/hid/0003:0B33.0030.0006/rdesc”    \# substitute your own numerical value}
    %\item \texttt{cat “/sys/kernel/debug/hid/0003:0B33.0030.0006/events”  \# press keys to see the results}
%\end{enumerate}

\subsection{Shuttle key default arrangement for \CGG{} / Composer / Viewer:}%
\label{sub:shuttle_key_default_cinelerra}

The following is the default setting for the ShuttlePROv2 and
ShuttleXpress (table~\ref{tab:shuttleprov2} and
table~\ref{tab:xpress}).  This page can be quickly requested from \CGG{} by
simultaeneously pressing the \texttt{Alt} key on the keyboard and any button on the Shuttle.

\renewcommand{\arraystretch}{1.15}
\begin{table}[ht]
  \caption{ShuttlePROv2 key default arrangement for \CGG{} /
    Composer / Viewer}
  \label{tab:shuttleprov2}
  % Tell table to adjust font to fix on the page using \resize
  \resizebox{\textwidth}{!}{%
    \begin{tabular}{c c c c c c c}
      \toprule
      K1 & K2 & & K3 & K4 & &\\
      Label & Future use & & Future use & Clip & &\\
         & Splice (viewer) & & Copy  & Overwrite (viewer) & &\\
      \midrule
      K5 & K6 & K7 & K8 & K9 & &\\
      Home & Reverse & Stop & Play & End & &\\
         & & Fullscreen & & & &\\
         & & (viewer / compositor) & & & &\\
      \midrule
      Home(Defaults) & MouseBtn1(D) & MouseBtn2(D) & MouseBtn3(D) & End(Defaults) & &\\
      \midrule
      \multicolumn{7}{c}{Shuttle Outer Wheel}\\
      \multicolumn{7}{c}{Play forward (first row) or Play reverse (second row)}\\
      S1=Stop  & S2=1/2 & S3=Normal  & S4=2x & S5=4x & S6=8x & S7=16x\\
      S-1=Stop &  S-2=1/2 & S-3=Normal & S-4=2x & S-5=4x & S-6=8x & S-7=16x\\
      \midrule
      K14 & & Jog Left & (Inner Wheel) & Jog Right & & K15\\
      Toggle In & & Frame reverse & & Frame forward & & Toggle Out\\
         & & Scroll up(Defaults) & & Scroll down(Defaults) & &\\
      \midrule
         & & K10  & &  K11 & &\\
         & & Previous Edit & & Next Edit & &\\
         & & Future Use(Viewer) & & Future Use(Viewer) & &\\
      \midrule
         & & K12  & &  K13 & &\\
         & & Previous Edit & & Next Edit & &\\
         & & Previous Label & & Next label & &\\
      \bottomrule
    \end{tabular}}
\end{table}

\begin{table}[ht]
  \caption{ShuttleXpress key default arrangement for \CGG{} / Composer / Viewer}
  \label{tab:xpress}
  % Tell table to adjust font to fix on the page using \resize
  \resizebox{\textwidth}{!}{%
    \begin{tabular}{c c c c c c c}
      \toprule
      K5 & K6 & K7 & K8 & K9 & &\\
      Home & Reverse & Stop & Play & End & &\\
         &         & Fullscreen & & & &\\
         &         & (viewer / compositor) & & & &\\
      \midrule
      Home(Defaults) & MouseBtn1(D) & MouseBtn2(D) & MouseBtn3(D) & End(Defaults) & &\\
      \midrule
      \multicolumn{7}{c}{Shuttle Outer Wheel}\\
      \multicolumn{7}{c}{Play forward (first row) or Play reverse (second row)}\\
      S1=Stop &   S2=1/2 &   S3=Normal  &  S4=2x  &  S5=4x  &  S6=8x &   S7=16x\\
      S-1=Stop &  S-2=1/2 &  S-3=Normal &  S-4=2x &  S-5=4x &  S-6=8x  & S-7=16x\\
      \midrule
         & & Jog Left & (Inner Wheel) & Jog Right & &\\
         & & Frame reverse & & Frame forward & &\\
         & & Scroll up(Defaults) & & Scroll down(Defaults) & &\\
      \bottomrule
    \end{tabular}}
\end{table}


%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../CinelerraGG_Manual"
%%% End:
