Commit Graph

529 Commits (5fa4889c9caa94f1811484164f5867a95f80d8f8)

Author SHA1 Message Date
jp9000 21ec81ebcc UI: Do not allow invalid downscale/rescale values
For the 'output resolution' setting in video settings, do not show
values in the list that it does not support (width must be aligned to a
128bit boundry, and height must be divisible by two)

For the 'rescale' settings in advanced outputs, the scales must all be
divisible by two.
2015-02-08 01:31:02 -08:00
jp9000 c69e7c96f3 UI: Base encoder rescales on output resolution
The 'rescale' values in advanced output section are supposed to be based
upon the output resolution of the program.  Meaning they should not be
used for scaling up, because the resolution downloaded from the graphics
processor is the output resolution set in video settings; thus any
resolution you set for the 'rescale' values is scaled from that.
2015-02-08 01:29:15 -08:00
jp9000 bd78db91e9 UI: Fix encoder rescaling for streaming
The "rescale" option for streaming in the advanced output settings was
not properly checking the parameter output of sscanf.  sscanf returns
the number of values that were found, not the number of string matches.
2015-02-08 01:11:34 -08:00
jp9000 bbd48c7bf2 UI: Isolate filter localization strings
To prevent from causing confusion/issues for our most awesome and
respected locale editors, only localize and translate the relevant text
rather than the extensions of the filter.
2015-02-07 12:12:12 -08:00
jp9000 b72e68afe7 (API Change) Fix obs_service_gettype func name
Before:                After:
obs_service_gettype    obs_service_get_type

It seems there was an API function that was missed when we were doing
our big API consistency update.  Unsquishes obs_service_gettype to
obs_service_get_type.
2015-02-07 08:19:34 -08:00
jp9000 69c6714090 UI: Make service settings use OK/Apply/Cancel
Currently service settings are updated in real time via the properties
view, which means that OK/Cancel/Apply have no effect.  This fixes that
by using the new type of properties view that operates only on settings
data, not an object.
2015-02-07 08:11:46 -08:00
jp9000 17c342bf61 UI: If active, prompt user before exiting
Precautionary measure to prevent the user from accidentally clicking the
'exit' buttons
2015-02-07 03:39:16 -08:00
jp9000 a3e47e53bf UI: Add button for adv. audio properties
Add a button to the main window to access advanced audio properties to
make it a bit more visible to users.

To facilitate this, the bottom part of the window was switched to a grid
layout.
2015-02-07 02:43:37 -08:00
jp9000 8ee3e41d09 UI: Remove unnecessary info from locale string
All outputs specify streaming/recording, there's no reason to say this
explicitly it just causes confusion about the advanced output.
2015-02-06 13:47:04 -08:00
jp9000 8b2614ddc2 UI: Add advanced output settings
Adds an 'advanced' mode to the output settings to allow more powerful
and complex streaming and recording options:

- Optionally use a different encoder for recording than for streaming to
  allow the recording to use a different encoder or encoder settings if
  desired (though at the cost if increased CPU usage depending on the
  encoders being used)

- Use encoders other than x264

- Rescale the recording or streaming encoders in case the user wishes to
  stream and record at different resolutions

- Select the specific mixer to use for recording and for streaming,
  allowing the stream and recording to use separate mixers (to for
  example allow a user to stream the game/mic audio but only record the
  game audio)

- Use FFmpeg output for the recording button instead of only recording
  h264/aac to FLV, allowing the user to output to various different
  types of file formats or remote URLs, as well as allowing the user to
  select and use different encoders and encoder settings that are
  available in the FFmpeg library

- Optionally allow the use of multiple audio tracks in a single output
  if the file formats or stream services support it
2015-02-06 11:55:48 -08:00
jp9000 a2373b1258 UI: Add buffer size to 'simple' settings 2015-02-06 03:56:19 -08:00
jp9000 07007bcc6e UI: Refactor output handling
To accommodate multiple types of outputs, there has to be some level of
abstraction.  The BasicOutputHandler structure will give us a way that
we can switch between different output configurations.
2015-02-06 03:17:33 -08:00
jp9000 efe31c9fe9 UI: Keep prop. view scroll positions if modified
If the properties view is scrolled down or right and a widget triggers
it to repaint, it would reset its scroll position, making editing a bit
awkward.  This simply saved/restores the position before and after
rebuilding the properties view.
2015-02-06 00:01:21 -08:00
jp9000 4983aaa586 UI: Clarify encoder preset usage
For the simple output section, clarifying that higher == less CPU is
pretty important.
2015-02-04 16:52:04 -08:00
jp9000 ac1651c7d3 UI: Add OBSPropertiesView::GetSettings
Allows the ability to get the current settings of a properties view
2015-02-04 16:52:03 -08:00
jp9000 cb70a531b7 UI: Add 'Changed' signal to properties view 2015-02-04 16:52:03 -08:00
jp9000 baaa061344 UI: Allow prop. view to be created via identifier
Allows a properties view control to be created only with an identifier
string instead of only being created with a pointer to an object.  This
way, we don't necessarily have to have an object for some arbitrary
settings we want the user to be able to modify.
2015-02-04 16:52:02 -08:00
jp9000 88d3c506ae UI: Use class member initialization for prop. view
Instead of setting every variable in the initializer list, use class
member initialization by default
2015-02-04 16:52:02 -08:00
jp9000 3423d2f505 UI: Use class member initializers for settings UI
Instead of using constructor initializer list, use class member
initialization
2015-02-04 16:51:59 -08:00
jp9000 fcb8561d6c UI: Rename 'x264 Preset' to 'Encoder Preset'
In the future, encoders other than x264 may end up filling this preset
list with their own values.
2015-02-04 16:51:54 -08:00
jp9000 8ffd7ec16c UI: Rename 'Custom x264 Settings'
Rename 'Custom x264 Settings' to 'Custom Encoder Settings', because it
may be useful to use this for encoders other than x264
2015-02-04 16:51:53 -08:00
jp9000 93ec22ff54 UI: Implement source mixer modification signals
Implement the signals for the mixer checkboxes in the advanced audio
control so that it properly relays the values to/from the source when
the mixers are changed in obs or when the mixers are changed by the
user.
2015-02-04 16:51:52 -08:00
jp9000 73d538102b UI: Set checkbox value without signaling
Instead of comparing the value of the checkbox to prevent recursive
signaling, just disable its ability to signal.
2015-02-04 16:51:52 -08:00
jp9000 82ca17ab66 UI: Rename 'Media Channel' to 'Tracks'
In the advanced audio properties, the last set of controls designate
what tracks the audio of a specific source is applied to, but for some
reason I named it 'Media Channels'.  It feels a bit confusing of a name.
I feel like it should really just be called 'Tracks' here for lack of a
better term.
2015-02-04 16:51:51 -08:00
jp9000 84e1f47ced (API Change) Add support for multiple audio mixers
API changed:
--------------------------

void obs_output_set_audio_encoder(
		obs_output_t *output,
		obs_encoder_t *encoder);

obs_encoder_t *obs_output_get_audio_encoder(
		const obs_output_t *output);

obs_encoder_t *obs_audio_encoder_create(
		const char *id,
		const char *name,
		obs_data_t *settings);

Changed to:
--------------------------

/* 'idx' specifies the track index of the output */
void obs_output_set_audio_encoder(
		obs_output_t *output,
		obs_encoder_t *encoder,
		size_t idx);

/* 'idx' specifies the track index of the output */
obs_encoder_t *obs_output_get_audio_encoder(
		const obs_output_t *output,
		size_t idx);

/* 'mixer_idx' specifies the mixer index to capture audio from */
obs_encoder_t *obs_audio_encoder_create(
		const char *id,
		const char *name,
		obs_data_t *settings,
		size_t mixer_idx);

Overview
--------------------------
This feature allows multiple audio mixers to be used at a time.  This
capability was able to be added with surprisingly very little extra
overhead.  Audio will not be mixed unless it's assigned to a specific
mixer, and mixers will not mix unless they have an active mix
connection.

Mostly this will be useful for being able to separate out specific audio
for recording versus streaming, but will also be useful for certain
streaming services that support multiple audio streams via RTMP.

I didn't want to use a variable amount of mixers due to the desire to
reduce heap allocations, so currently I set the limit to 4 simultaneous
mixers; this number can be increased later if needed, but honestly I
feel like it's just the right number to use.

Sources:

Sources can now specify which audio mixers their audio is mixed to; this
can be a single mixer or multiple mixers at a time.  The
obs_source_set_audio_mixers function sets the audio mixer which an audio
source applies to.  For example, 0xF would mean that the source applies
to all four mixers.

Audio Encoders:

Audio encoders now must specify which specific audio mixer they use when
they encode audio data.

Outputs:

Outputs that use encoders can now support multiple audio tracks at once
if they have the OBS_OUTPUT_MULTI_TRACK capability flag set.  This is
mostly only useful for certain types of RTMP transmissions, though may
be useful for file formats that support multiple audio tracks as well
later on.
2015-02-04 16:51:29 -08:00
HomeWorld 0fea987ed4 UI: Apply a style sheet using path
This allows the usage of other resources in the style sheet, like
icons/etc, relative to the style sheet location.  For example, to change
the main window app icon, add #OBSBasic { qproperty-windowIcon:
url("basic/newicon.png") } in the style sheet, where "basic/newicon.png"
is a path relative to the qss file location.
2015-01-26 11:48:32 -08:00
jp9000 4093ce4d84 UI: Fix bug when canceling first source properties
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.
2015-01-24 22:10:37 -08:00
HomeWorld 5b641d87fb UI: Fix missing widget parent from constructor
The styling isn't applied if the widget doesn't have a parent
2015-01-16 11:21:11 +02:00
Blackhive 9b3c204707 UI: Enable load of stylesheet.qss from config dir
This will allow obs to load stylesheet.qss (Qt stylesheet). It enables
users to theme obs how they please within Qt stylesheet guidelines. A
default stylesheet is not yet available.
2015-01-16 00:28:25 -08:00
jp9000 14488a8c2f UI: Fix constructor reorder warning
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.
2015-01-16 00:05:09 -08:00
jp9000 82320a9ca7 (API Change) Make os_get_config_path safer to use
Changed:
  char *os_get_config_path(const char *name);

To:
  int os_get_config_path(char *dst, size_t size, const char *name);

Also added:
  char *os_get_config_path_ptr(const char *name);

I don't like this function returning an allocation by default.
Similarly to what was done with the wide character conversion functions,
this function now operates on an array argument, and if you really want
to just get a pointer for convenience, you use the *_ptr version of the
function that clearly indicates that it's returning an allocation.
2015-01-15 23:44:38 -08:00
Jim 2fec0f82c2 Merge pull request #337 from Blackhive/volume_meter
obs: Allow styling of volume meters
2015-01-15 22:15:18 -08:00
Jim bffd75cba4 Merge pull request #338 from Blackhive/layout_update
UI: Fix minor stylesheet issues
2015-01-15 22:10:31 -08:00
Weikardzaena 2152b40e68 UI: Add Okay/Cancel Buttons to Properties Dialog
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.
2015-01-15 21:49:03 -08:00
Blackhive e198e27997 UI: Fix minor stylesheet issues
This does a few small things
-Moves buttons down 20px to the same height as the list boxes
-Adds a QFrame around scrollArea for mixer list.

Q: Why was this done?
A: When you go to style the mixer list in regards to adding a border,
shadow, or glow, it needs to be done on the QFrame. If you do it on the
scrollArea itself, the scrollbars will overlap the bottom of the border,
causing the border to look cut-off. Additionally, the other two sources
and scenes list widgets already had frames, so they did not have this
problem.
2015-01-14 02:15:30 -05:00
Blackhive 988c0db1f6 obs: Allow styling of volume meters
This will allow styling of the volume meters so that users are not stuck
with the default colors when they style a theme. Volume meters' colors can
be changed in stylesheet.qss using the following format as an example:

VolumeMeter {
qproperty-bkColor: #DDDDDD;
qproperty-magColor: #207D17;
qproperty-peakColor: #3EF12B;
qproperty-peakHoldColor: #000000;
}
2015-01-14 02:01:20 -05:00
Carl Fürstenberg 6095e7ef51 Add SOVERSION to libobs-opengl
Because libobs-opengl is a public library, it's customary to have SONAME
embedded in the library file.  Also remove the prefix override and
remove the prefixing "lib" from the output name.  This also requires us
to pass the library file name to dlopen invocations.
2015-01-13 17:51:38 -08:00
jp9000 f58ca29484 UI: Use config file for color format/space/range
Allows the color format, color space, and color range to be set by the
user.  This will need user interface for in the future, though it'll
have to be an advanced setting that's hidden from the user by default
because I don't feel comfortable exposing this to a typical user.
2015-01-10 18:35:58 -08:00
HomeWorld d9ec2128f2 UI: Removed an unnecesary setSizeConstraint call
This setSizeConstraint(QLayout::SetMaximumSize) call
caused the widgets to be improperly sized.
For example: combo boxes with long texts ('big' widget width) not
being completly visible.
2015-01-05 15:41:25 +02:00
HomeWorld db3b666df5 UI: Fix properties window size grip position on resize
To have its position updated, QDialog::resizeEvent must
be called.
2015-01-05 14:23:12 +02:00
HomeWorld 24776b7f65 UI: Use SourceListWidget for sources list 2015-01-05 03:39:01 -08:00
HomeWorld 88333b0f47 UI: Add SourceListWidget - QListWidget subclass
The default behavior of QListWidget is to allow double clicks of any
mouse button, but in certain situations/usage cases this can cause
undesirable results.  As an example: when double-clicking with the right
mouse button on an item in the sources list box, it will open up both
the properties window and the context menu.  Not pretty at all.

This subclass filters out double clicks for any mouse button other than
the left mouse button to fix this issue.
2015-01-05 03:38:18 -08:00
jp9000 e9f8374bf4 UI: Load debug privileges for program
Debug privileges help prevent issues with things like game capture
2015-01-05 02:45:41 -08:00
jp9000 e8002dc9ed UI: Save at regular intervals
Save the file when "start recording" or "start streaming" is clicked,
and also save at every 20 second interval
2015-01-05 02:45:40 -08:00
jp9000 0332cdce1c UI: Remove some trailing whitespace 2015-01-05 02:45:39 -08:00
jp9000 ebc2d4ab11 UI: Implement SaveProject function 2015-01-05 02:45:39 -08:00
jp9000 290975e3a0 UI: Set a maximum height to properties scroll area
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.
2015-01-05 02:10:34 -08:00
jp9000 82b36ca41e UI: Allow buttons to refresh properties view
I forgot to check the return value from the button to see if the button
wanted the UI to be refreshed or not.
2015-01-05 02:10:07 -08:00
jp9000 ef6064b9b5 UI: Always hide VScrollArea horizontal scroll bar
There appears to be a bug with displaying the vertical scroll bar widget
where the horizontal scroll bar will show when it's not supposed to.
Fortunately it can be completely disabled.
2015-01-03 07:32:04 -08:00
jp9000 b2b76559f3 UI: Fix property scroll area widget not resizing
If QScrollArea::resizeEvent is not called, then the internal widget does
not get automatically resized when it's set to automatically be resized.
2015-01-03 07:31:51 -08:00