Ardour  8.7-14-g57a6773833
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 #ifndef __temporal_domain_swap_h__
20 #define __temporal_domain_swap_h__
21 
22 #include <set>
23 
24 #include "pbd/command.h"
25 #include "pbd/destructible.h"
26 #include "pbd/signals.h"
27 
28 #include "temporal/types.h"
29 #include "temporal/timeline.h"
30 
31 namespace Temporal {
32 
33 typedef std::map<timepos_t*,timepos_t> TimeDomainPosChanges;
34 typedef std::map<timecnt_t*,timecnt_t> TimeDomainCntChanges;
35 
37 
39  public:
40  virtual ~TimeDomainSwapper() {}
43 };
44 
45 /* A DomainBounceInfo functions in two roles:
46  *
47  * 1. as part of an UndoTransaction reflecting actions taken by a user that
48  * modified time domains of one or more objects.
49  *
50  * 2. as a standalone object used during temporary domain swaps that records
51  * (perhaps opaquely) what was changed and provides a way to revert it.
52  */
53 
55 {
56  DomainBounceInfo (TimeDomain f, TimeDomain t, bool m = false)
57  : from (f)
58  , to (t)
59  , move_markers (m)
60  {}
61 
63  const TimeDomain to;
64 
67 
69 };
70 
71 }
72 
73 #endif /* __tmeporal_domain_swap_h__ */
std::map< timepos_t *, timepos_t > TimeDomainPosChanges
Definition: domain_swap.h:33
std::map< timecnt_t *, timecnt_t > TimeDomainCntChanges
Definition: domain_swap.h:34
TimeDomainPosChanges positions
Definition: domain_swap.h:65
TimeDomainCntChanges counts
Definition: domain_swap.h:66
const TimeDomain from
Definition: domain_swap.h:62
DomainBounceInfo(TimeDomain f, TimeDomain t, bool m=false)
Definition: domain_swap.h:56
const TimeDomain to
Definition: domain_swap.h:63
virtual void start_domain_bounce(DomainBounceInfo &)=0
virtual void finish_domain_bounce(DomainBounceInfo &)=0
#define LIBTEMPORAL_API