Apparently using QPointer container for the QObject being given to the
connect function makes it so it can't find the actual function to use.
I'm guessing this is incomplete functionality or a bug that existed in
GCC 4.8. Doesn't happen in 4.9+.
(Non-compiling commit: windowless-context branch)
Now that all obs_display related code has been moved to OBSQTDisplay,
we can prune a whole bunch of boilerplate code that had to be repeated
for the displays of each window.
Affects:
- Properties
- Filters
- Interact
- Projector
This prevents the weird stretching effect that occurs whenever a windows
is in the process of being resized by the user.
Originally it was intended as an optimization, but even on half-decent
computers it doesn't really have much benefit.
The update_properties signal is created before the view itself is
created, therefore it was possible for the callback to trigger when the
view was invalid.
When viewing the properties of a source, there's no way to specify that
a source is actually being shown or not to the core. This uses the new
obs_source_inc_showing and obs_source_dec_showing to tell the source
that it's being shown/hidden in this part of the program without
necessarily having to use a new render view just to render it.
When you launch the source properties for the first time, the settings
for the source are empty and default values are used. With the new
OK/Cancel buttons that were recently merged, it first saves the old
settings, then if the user cancels applies those old settings.
However, because the first settings are always empty, obs_source_update
will try to apply the old settings (which are empty) to the modified
settings, but it can't reset to those settings because it's technically
not applying any settings at all.
In other words, when you create the source and modified the properties
for your first time, pressing cancel would not reset anything at all.
This fixes that issue by clearing the current settings with
obs_data_clear before updating the source with the old settings, which
ensures that any settings that were empty are reset to an empty status.
The class members were listed in the wrong order, causing GCC to throw
up a reorder warning signifying that they cannot be initialized in the
order they were listed in the constructor initializer list.
Use QDialogButtonBox to add "Okay" and "Cancel" buttons to the
properties dialog. The core functionality of the dialog is not changed;
I.E. the settings are still applied to the source as the user changes
them. If the user clicks "Okay", the dialog simply exits. If the user
clicks "Cancel", the original settings are reapplied to the source then
the dialog exits. If the window is closed by any other means (I.E. by
the main obs window closing) then the properties dialog prompts the user
if they changed anything and asks if they wish to save their settings.
In order to implement this last feature, a method of checking for open
dialogs and sending each a quit message is added to the closeEvent()
method for OBSBasic.
When a source has a lot of properties, the scroll area containing them
would try to expand to fit them all, often leaving the preview area
super squished. So this just sets a maximum height for the properties
scroll area.
Typedef pointers are unsafe. If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data. I admit this was a fundamental mistake that must
be corrected.
All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.
This does not break ABI though, which is pretty nice.
If the properties view changed in the properties window, the viewport of
the properties would not trigger a resize because the size of the window
itself does not change. This creates a signal that allows the parent to
know whether or not to update a viewport, if any.
Instead of having functions like obs_signal_handler() that can fail to
properly specify their actual intent in the name (does it signal a
handler, or does it return a signal handler?), always prefix functions
that are meant to get information with 'get' to make its functionality
more explicit.
Previous names: New names:
-----------------------------------------------------------
obs_audio obs_get_audio
obs_video obs_get_video
obs_signalhandler obs_get_signal_handler
obs_prochandler obs_get_proc_handler
obs_source_signalhandler obs_source_get_signal_handler
obs_source_prochandler obs_source_get_proc_handler
obs_output_signalhandler obs_output_get_signal_handler
obs_output_prochandler obs_output_get_proc_handler
obs_service_signalhandler obs_service_get_signal_handler
obs_service_prochandler obs_service_get_proc_handler
This refactors the sub-window code a bit so that instead of deleting the
window pointers, it calls QWidget::close() on them to safely trigger a
normal close on them instead (which will also delete them).
Moves setting the DeleteOnClose flag from inside of the Dialog classes
into the OBSBasic class, to make that behaviour more obvious.
The locale parameter was a mistake, because it puts extra needless
burden upon the module developer to have to handle this variable for
each and every single callback function. The parameter is being removed
in favor of a single centralized module callback function that
specifically updates locale information for a module only when needed.
It didn't really look very nice in most cases and the controls were
always compacted, doing this makes it look a bit better.
Also change it so the properties window shows the properties on the
bottom below the source rather than to the right, seeing as in most
cases the source has a greater width than height, and it feels just a
little bit better to look at (thought that's just my opinion).
Controls still stretch really far sometimes though, I wonder what should
be done about that to be honest. Maybe prevent it from scrolling to the
right?
Drawing position wasn't being calculated correctly, viewport/ortho
should have been used instead. It would cause items to render out of
position on the main viewport (though not on the actual output)
On OSX clicking the X title bar button immediately destroys "all" native
windows (after sending a close event) which causes
[NSSurface _disposeSurface] to crash if invoked while GL is using
the surface
This should fix GS rendering on surfaces on HiDPI displays; moving
windows between displays with differing pixel ratios currently requires
a manual resize
Previously the properties window would sometimes not receive
a closeEvent, leaving a dangling pointer in OBSBasicMain (and resulting
in a crash when trying to open a new properties window or closing
the application)
- Add a properties window for sources so that you can now actually edit
the settings for sources. Also, display the source by itself in the
window (Note: not working on mac, and possibly not working on linux).
When changing the settings for a source, it will call
obs_source_update on that source when you have modified any values
automatically.
- Add a properties 'widget', eventually I want to turn this in to a
regular nice properties view like you'd see in the designer, but
right now it just uses a form layout in a QScrollArea with regular
controls to display the properties. It's clunky but works for the
time being.
- Make it so that swap chains and the main graphics subsystem will
automatically use at least one backbuffer if none was specified
- Fix bug where displays weren't added to the main display array
- Make it so that you can get the properties of a source via the actual
pointer of a source/encoder/output in addition to being able to look
up properties via identifier.
- When registering source types, check for required functions (wasn't
doing it before). getheight/getwidth should not be optional if it's
a video source as well.
- Add an RAII OBSObj wrapper to obs.hpp for non-reference-counted
libobs pointers
- Add an RAII OBSSignal wrapper to obs.hpp for libobs signals to
automatically disconnect them on destruction
- Move the "scale and center" calculation in window-basic-main.cpp to
its own function and in its own source file
- Add an 'update' callback to WASAPI audio sources