Ardour  9.0-pre0-582-g084a23a80d
domain_swap.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 
21 #include <set>
22 
23 #include "pbd/command.h"
24 #include "pbd/destructible.h"
25 #include "pbd/signals.h"
26 
27 #include "temporal/types.h"
28 #include "temporal/timeline.h"
29 
30 namespace Temporal {
31 
32 typedef std::map<timepos_t*,timepos_t> TimeDomainPosChanges;
33 typedef std::map<timecnt_t*,timecnt_t> TimeDomainCntChanges;
34 
36 
38  public:
39  virtual ~TimeDomainSwapper() {}
42 };
43 
44 /* A DomainBounceInfo functions in two roles:
45  *
46  * 1. as part of an UndoTransaction reflecting actions taken by a user that
47  * modified time domains of one or more objects.
48  *
49  * 2. as a standalone object used during temporary domain swaps that records
50  * (perhaps opaquely) what was changed and provides a way to revert it.
51  */
52 
54 {
55  DomainBounceInfo (TimeDomain f, TimeDomain t, bool m = false)
56  : from (f)
57  , to (t)
58  , move_markers (m)
59  {}
60 
62  const TimeDomain to;
63 
66 
68 };
69 
70 }
71 
std::map< timepos_t *, timepos_t > TimeDomainPosChanges
Definition: domain_swap.h:32
std::map< timecnt_t *, timecnt_t > TimeDomainCntChanges
Definition: domain_swap.h:33
TimeDomainPosChanges positions
Definition: domain_swap.h:64
TimeDomainCntChanges counts
Definition: domain_swap.h:65
const TimeDomain from
Definition: domain_swap.h:61
DomainBounceInfo(TimeDomain f, TimeDomain t, bool m=false)
Definition: domain_swap.h:55
const TimeDomain to
Definition: domain_swap.h:62
virtual void start_domain_bounce(DomainBounceInfo &)=0
virtual void finish_domain_bounce(DomainBounceInfo &)=0
#define LIBTEMPORAL_API