Commit graph

219 commits

Author SHA1 Message Date
0f5280a4f0 UI-top-level: draft a concept how to attach actions to the current window (#1069)
This is a very pervasive change and basically turns the whole top-level
of the GTK-UI bottom-up. If this change turns out right, it would likely
solve #1048

WARNING: in parts not implemented, breaks UI
2017-02-01 03:55:20 +01:00
865ee11621 UI-top-level: push down Config access to actual usage site (#1067)
...allows us to get rid of the access key constants and the
accessor functions in GtkLumiera
2017-02-01 03:46:30 +01:00
4e1641f192 sketchy workaround for access to the PlayController (#1072)
...which itself is obsolete and needs to be redesigned from scratch.
For now we create a local instance of this obsolete PlaybackController
in each viewer panel and we use a static accessor function to just some
instance. Which would break if we start playback with multiple viewer
panels. But we can't anyway, since the Player itself is also a broken
leftover from an obsoleted design study from the early days.

so why care...
2017-01-28 01:11:04 +01:00
c09eb3e1ed remove the obsolete Project and Controler from ctor arguments
...this (finally) allows us to get rid of these elements within GtkLumiera.
Our Model will be represented in a quite different way (via UI-Bus).
2017-01-27 23:30:38 +01:00
d49983d4cb identify items which force GtkLumiera to be a singleton
- WindowList (ex WindowManager)
- Project & Controller

the latter ones are defunct and can be replicated down into each
of the old timeline pannel instances. They just serve the purpose
to keep this old code barely functional, so it can be used as reference
for building the new timeline
2017-01-27 22:17:58 +01:00
86d6e11505 demote the WindowManager to be a petty window list (#1964)
the only adequate thing you can do with managers is to demote them.
2017-01-27 20:48:01 +01:00
1cb2567557 Ui-top-level: use a sincle UiManager instance
instead of letting each window create its own "private interface"
2017-01-26 22:02:45 +01:00
43bd5c3f57 further decisions regarting the UI top-level 2017-01-26 20:51:43 +01:00
7a51a0bd18 split functionality according to concerns (#1067)
window handling -> WindowManager
styles, icons, themes  -> UiManager
2017-01-23 01:13:38 +01:00
735563ebc5 Rectify UI top-level -- introduce a global UiManager (#1067)
There seems to be a mismatch in the arrangement of the top-level entities
 * we support multiple windows, yet from reading the code, you'd ge the impression we aren't really aware we have multiple top-level windows
 * the `WindowManager` is the core UI manager, which feels like a mix-up in concerns
 * the `WorkspaceWindow::createUI()` does the global UI initialisation. Again, we have multiple workspace windows.
 * `GtkLumiera::main()` creates a `Model` and a `Controller` in local function scope, but stores the `WindowManager` in an object field.
 * it seems, for that very reason, `GtlLumiera` needed to be a singleton, to allow by-name access to "the" `WindowManager`
 * needless to say, this causes a host of problems when shutting down the UI.

The idea is to introduce a dedicated UiManager, to deal with the central
framework induced concerns solely, and to demote the WindowManager and the
WorkspaceWindows to care only for their local concerns
2017-01-23 00:40:17 +01:00
6baff38beb GuiNotification: actually pass the calls through the interface system 2017-01-20 04:23:00 +01:00
0d5ca55019 GuiNotification: define outline of this service interface 2017-01-20 03:27:32 +01:00
8105be399e GuiNotification: demote this service to be just a BusTerm
in fact it just does not fulfil any of the behavioural properties
of a full-fledged UI-Element. All it needs is an uplink bus connection,
so let's just keep it as that

Sidenote: I've realised today that such a "free standing" BusTerm
without registration in Nexus is a good idea and acceptable solution.
2017-01-20 02:40:38 +01:00
8f2023dea3 Nexus/CoreService: verify shutdown cycle
yes, it's a cycle and indeed quite tricky.
Just verified it (again) with the debugger and saw all
dtor calls happening in the expected order. Also the number
of Nexus registration is sane
2017-01-20 02:23:24 +01:00
06a61773fa Nexus/CoreService: consider handling of bus connections.
Now I've realised that there are two degrees of connectedness.
It is very much possible to have a "free standing" BusTerm, which
only allows to send uplink messages. In fact, this is how CoreService
is implemented, and probably it should also the way how to connect
the GuiNotification service...
2017-01-20 01:54:49 +01:00
2354c53a50 GuiStart / Shutdown: nailed the Heisenbug
Reason was some insideous detail regarding Lambdas:
When a Lambda captures context, a *closure* is created.
And while the Lambda itself is generated code, pretty much
like an anonymous function, the closure depends on the context
that was captured. In our case here, the Lambda used to start
the thread was the problem: it captured the termCallback functor
from the argument of the enclosing function. In fact it did not
help or change anything if we successively package that lambda
into a function objet and store this by value, because the
lambda still refers to the transient function context present
on stack at the moment it was captured.

The solution is to revert back to a bind expression, since this
creates a dedicated storage for the bound function arguments
managed within the bind-functor. This makes us independent
from the call context
2017-01-19 23:41:32 +01:00
22be990631 GuiStart / shutdown: chasing a Heisenbug 2017-01-19 23:08:09 +01:00
4ba8032a60 Nexus/CoreService: fix sanity check on shutdown
...because some Bus connections stem from elements which are
member of CoreService, thus the'll still be connected when the
sanity check in the dtor runs

But even with this fix, we still get a SEGFAULT
2017-01-19 23:08:09 +01:00
aec700f1b1 GuiNotification: connect to UI-Bus by inheriting from Controller
TODO
 - is this actually a sensible idea, from a design viewpoint?
 - in which way to bind GuiNotification for receiving diff messages?
 - Problem with disconnnecting from Nexus on shutdown
2017-01-19 23:08:09 +01:00
2045132d3e SessionCommand: multithreaded stress test PASS (closes #1046)
Writing and debugging such tests is always an interesting challenge...

Fortunately this exercise didn't unveil any problem in the newly written
code, only some insidious problems in the test fixture itself. Which
again highlights the necessity, that each *command instance* needs
to be an independent clone from the original *command prototype*,
since argument binding messages and trigger messages can appear
in arbitrary order.
2017-01-14 08:37:46 +01:00
0b0575050d SessionCommand: second function test PASS 2017-01-13 09:01:05 +01:00
2e9bd78791 consider to extend the command handling protocol on UI-Bus (#1058) 2017-01-09 03:24:17 +01:00
38b908d510 CoreService: simple (and obvious) implementation of command handling (#1046)
disregarding all doubts due to the massive indirection
and deferring the question where command-IDs are actually to be allocated....
2017-01-09 02:32:56 +01:00
cfbbb750f8 considerations regarding the integration of commmand invocations (#1046)
not quite sure how to get the design straight.
Also a bit concerned because we'll get this much indirections;
the approach to send invocations via the UI-Bus needs to prove its viability
2017-01-09 01:22:43 +01:00
c2c6262be6 mark where command handling needs to be integrated (#1046) 2017-01-07 03:18:39 +01:00
c0337abcaf Application: from now on start the »session subsystem« (closes #699) 2017-01-07 02:48:51 +01:00
dd041ff80c Library: thread self recognition implemented and tested (closes #1054) 2017-01-07 01:01:39 +01:00
458fda4058 DispatcherLoop implementation complete (closes #1049)
Did a full review of state and locking logic, seems airtight now.
- command processing itself is unimplemented, we log a TODO message for now
- likewise, builder is not implemented
- need to add the deadlock safeguard #1054
2017-01-05 23:36:42 +01:00
3915e3230e DispatcherLoop: add wake-up notification on state change 2017-01-05 21:40:37 +01:00
f26ef5230c CommandQueue: finish integration into ProcDispatcher
...leaving out the *actual operations* of
- command dispatch
- builder run
2017-01-05 20:43:53 +01:00
1b970cd943 Session-Subsytem(#318): finish review of locking and lifecycle sanity
This subsystem as such can be considered as implemented now,
while several details still wait to be filled in.
2017-01-05 03:38:46 +01:00
77303ad007 Session-Subsystem(#318): investigation of locking sanity (ongoing...)
Found an inconsistency and a deadlock!
See proc-dispatcher.cpp, the lambda embedded into the start() operation!
2017-01-04 01:44:35 +01:00
34686713d4 Proc-Layer: Builder is not a subsystem (anymore)
We found out that it's best to run it single threaded
within the session loop thread. This does not mean the Builder
itself is necessarily single threaded, but the Builder's top level
will block any other session operation, and this is a good thing.
For this reason it makes more sense to have the Builder integrated
as a component into the session subsystem.
2017-01-03 21:10:27 +01:00
b6d5cd1c76 SessionCommandService implemented by delegating to the ProcDispatcher 2016-12-23 23:42:27 +01:00
b3f0605b9b SessionCommand-facade: consider how to expose command invocation
after reading some related code, I am leaning towards a design
to mirror the way command messages are sent over the UI-Bus.

Unfortunately this pretty much abandons the possibility to
invoke these operations from a client written in C or any
other hand made language binding. Which pretty much confirms
my initial reservation towards such an excessively open
and generic interface system.
2016-12-23 07:26:00 +01:00
8bbc0fb97f more clean-up and comments 2016-12-22 19:35:42 +01:00
0d436deb9e clean-up and comments for the implementation finished thus far 2016-12-22 04:04:41 +01:00
96def6b1ba Looper: elaborate implementation
looks doable indeed...
2016-12-22 03:12:14 +01:00
6073df3554 Looper: other (better?) idea how to handle "builder dirty" automatically
...this means to turn Looper into a state machine.
Yet it seems more feasible, since the DispatcherLoop has a nice
checkpoint after each iteration through the while loop, and we'd
keep that whole builder-dirty business completely confined within
the Looper (with a little help of the DispatcherLoop)

Let's see if the state transition logic can actually be implemented
based just on such a checkpoint....?
2016-12-20 03:53:48 +01:00
bae3d4b96f mark a solution how to create a safeguard against deadlock on session shutdown
....if by some weird coincidence, a command dispatched into the session
happens to trigger session shutdown or re-loading, this will cause a deadlock,
since decommissioning of session data structures must wait for the
ProcDispatcher to disable command processing -- and this will obviously
never happen when in a callstack below some command execution!
2016-12-20 02:35:45 +01:00
746866f5fc Looper: draft requirements on logic for triggering the builder 2016-12-16 23:56:53 +01:00
53ed0e9aa3 ProcDispatcher: consider and document the fine points of operational semantics
there are some pitfalls related to timing and state,
especially since some state changes are triggered, but not immediately reached
2016-12-16 23:11:19 +01:00
7b860947b1 ProcDispatcher: skeleton of the processing loop
including a draft of the Looper control component and the
invocation of the object monitor for waiting on condition var
2016-12-15 22:15:20 +01:00
00077d0431 ProcDispatcher: decide on requirements and implementation structure (#1049) 2016-12-15 20:48:35 +01:00
7e65dda771 draft request to halt the dispatcher loop 2016-12-15 06:21:59 +01:00
86f446c197 better control of the shutdown sequence
holding the SessionCommandService in a unique_ptr allows us to
close the Interface reliably *before* the Loop is halted.
2016-12-15 05:54:48 +01:00
1ec883787a DOC: decision about where to home the SessionCommandService
After some consideration, it became clear that this service implementation
is closely tied to the DispatcherLoop -- which will consequently be
responsible to run and expose this service implementation
2016-12-15 05:07:40 +01:00
eb73242113 document decisions regarding session subsystem components and lifecycle
* "session subsystem" == running the ProcDispatcher
* session itself is pulled up on demand by the SessionManager
2016-12-14 05:10:51 +01:00
479f4170c2 implement activated state
need to keep state variables on both levels,
since the session manager (lifecycle) "opens" the session
for external access by starting the dispatcher; it may well happen
thus that the session starts up, while the *session subsystem*
is not(yet) started
2016-12-14 04:57:08 +01:00
a853851447 add complete locking to the ProcDispatcher
on both levels
- the front-end needs locking to ensure consistent state (memory barrier)
- the back-end nees locking to coordinate command processing
2016-12-14 04:18:58 +01:00