1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Merge branch 'feature/autostartWallpaper' into 'dev'

Feature/autostart wallpaper

See merge request kelteseth/ScreenPlay!11
This commit is contained in:
Elias Steurer (Kelteseth) 2019-06-11 13:51:49 +00:00
commit fffb3046db
89 changed files with 2152 additions and 1615 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "ScreenPlay/ThirdParty/stomt-qt-sdk"]
path = ScreenPlay/ThirdParty/stomt-qt-sdk
url = https://github.com/Aimber/stomt-qt-sdk.git
[submodule "Common/vcpkg"]
path = Common/vcpkg
url = https://github.com/Microsoft/vcpkg.git

View File

@ -6,11 +6,11 @@ Every changes to ScreenPlay are done via Gitlab issues and merge requests (pull
### Development
1. Accept the [Contributing Agreement](https://gitlab.com/aimber/ScreenPlay).
2. Download and set up ScreenPlay as described in the main [Readme](https://gitlab.com/aimber/ScreenPlay).
1. Accept the [Contributing Agreement](https://gitlab.com/kelteseth/ScreenPlay).
2. Download and set up ScreenPlay as described in the main [Readme](https://gitlab.com/kelteseth/ScreenPlay).
2. Choose an issue to work on:
* Your own ideas or thinks you want to improve. Alternatively you can tackle existing open issues:
* You can find simple problems by [searching for problems labeled "Accepting merge requests" sorted by weight.](https://gitlab.com/aimber/ScreenPlay/issues?state=opened&label_name[]=Accepting+merge+requests&assignee_id=0&sort=weight). Low-weight issues will be the easiest to accomplish.
* You can find simple problems by [searching for problems labeled "Accepting merge requests" sorted by weight.](https://gitlab.com/kelteseth/ScreenPlay/issues?state=opened&label_name[]=Accepting+merge+requests&assignee_id=0&sort=weight). Low-weight issues will be the easiest to accomplish.
* Make sure that no one else is working on the problem and make sure that we are still interested in a particular post.
* You can also make comments and ask for help if you are new or stuck. We will be happy to help you!
3. Add the feature or fix the bug youve chosen to work on.
@ -35,7 +35,7 @@ Every changes to ScreenPlay are done via Gitlab issues and merge requests (pull
### Documentation
To contribute to the [documentation](https://aimber.gitlab.io/ScreenPlayDocs/) you only have to press the pen icon on the top right of every page. We mostly use [draw.io]( http://draw.io/) for every diagram because it is free and you can embed the code inside a png when exporting the document.
To contribute to the [documentation](https://kelteseth.gitlab.io/ScreenPlayDocs/) you only have to press the pen icon on the top right of every page. We mostly use [draw.io]( http://draw.io/) for every diagram because it is free and you can embed the code inside a png when exporting the document.
### Translation

1
Common/vcpkg Submodule

@ -0,0 +1 @@
Subproject commit 745a0aea597771a580d0b0f4886ea1e3a94dbca6

13
Legal/README.md Normal file
View File

@ -0,0 +1,13 @@
## Contributor license agreement
By submitting code as an individual you agree to the
[individual contributor license agreement](Legal/individual_contributor_license_agreement.md).
By submitting code as an entity you agree to the
[corporate contributor license agreement](Legal/corporate_contributor_license_agreement.md).
All Documentation content that resides under the [ScreenPlay/docs/ directory]([ScreenPlay/docs) of this
repository is licensed under Creative Commons:
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
## Why
You must agree to our license agreement when contributing to ScreenPlay. ScreenPlay is and always be free software (AGPL V3). For distributing ScreenPlay in various ways like stores we need your permission to use your code under a second license (Commercial dual licensing like the Qt Framework).

671
Legal/ScreenPlay License.md Normal file
View File

@ -0,0 +1,671 @@
See
* corporate_contributor_license_agreement.md
* individual_contributor_license_agreement.md
for the commercial License.
######################################################################
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
1. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View File

@ -0,0 +1,29 @@
# Corporate contributor license agreement
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Elias Steurer (Kelteseth). Except for the license granted herein to Elias Steurer (Kelteseth) and recipients of software distributed by Elias Steurer (Kelteseth), You reserve all right, title, and interest in and to Your Contributions.
1. Definitions.
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Elias Steurer (Kelteseth). For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"Contribution" shall mean the code, documentation or other original works of authorship, including any modifications or additions to an existing work, that is submitted by You to Elias Steurer (Kelteseth) for inclusion in, or documentation of, any of the products owned or managed by Elias Steurer (Kelteseth) (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Elias Steurer (Kelteseth) or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Elias Steurer (Kelteseth) for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
2. Grant of Copyright License.
Subject to the terms and conditions of this Agreement, You hereby grant to Elias Steurer (Kelteseth) and to recipients of software distributed by Elias Steurer (Kelteseth) a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
3. Grant of Patent License.
Subject to the terms and conditions of this Agreement, You hereby grant to Elias Steurer (Kelteseth) and to recipients of software distributed by Elias Steurer (Kelteseth) a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
4. You represent that You are legally entitled to grant the above license. You represent further that each of Your employees is authorized to submit Contributions on Your behalf, but excluding employees that are designated in writing by You as "Not authorized to submit Contributions on behalf of [name of Your corporation here]." Such designations of exclusion for unauthorized employees are to be submitted via email to legal@screen-play.app.
5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others).
6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
7. Should You wish to submit work that is not Your original creation, You may submit it to Elias Steurer (Kelteseth) separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
8. It is Your responsibility to notify screen-play.app when any change is required to the list of designated employees excluded from submitting Contributions on Your behalf per Section 4. Such notification should be sent via email to info@screen-play.app.
This text is licensed under the [Creative Commons Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0/) and the original source is the Google Open Source Programs Office.

View File

@ -0,0 +1,25 @@
# Individual contributor license agreement
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Elias Steurer (Kelteseth). Except for the license granted herein to Elias Steurer (Kelteseth) and recipients of software distributed by Elias Steurer (Kelteseth), You reserve all right, title, and interest in and to Your Contributions.
1. Definitions.
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Elias Steurer (Kelteseth). For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Elias Steurer (Kelteseth) for inclusion in, or documentation of, any of the products owned or managed by Elias Steurer (Kelteseth) (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Elias Steurer (Kelteseth) or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Elias Steurer (Kelteseth) for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Elias Steurer (Kelteseth) and to recipients of software distributed by Elias Steurer (Kelteseth) a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Elias Steurer (Kelteseth) and to recipients of software distributed by Elias Steurer (Kelteseth) a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Elias Steurer (Kelteseth), or that your employer has executed a separate Corporate CLA with Elias Steurer (Kelteseth).
5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
7. Should You wish to submit work that is not Your original creation, You may submit it to Elias Steurer (Kelteseth) separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [insert_name_here]".
8. You agree to notify Elias Steurer (Kelteseth) of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
This text is licensed under the [Creative Commons Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0/) and the original source is the Google Open Source Programs Office.

View File

@ -4,7 +4,7 @@ SUBDIRS += \
ScreenPlaySDK/ScreenPlaySDK.pro \
ScreenPlayWindow/ScreenPlayWindow.pro \
ScreenPlayWidget/ScreenPlayWidget.pro \
#ScreenPlay/ThirdParty/stomt-qt-sdk/sdk/stomt-qt-sdk.pro \
ScreenPlay/ThirdParty/stomt-qt-sdk/sdk/stomt-qt-sdk.pro \
ScreenPlayWindow.depends = ScreenPlaySDK
ScreenPlayWidget.depends = ScreenPlaySDK

View File

@ -77,7 +77,6 @@
<file>main.qml</file>
<file>qml/Community/Community.qml</file>
<file>qml/Community/Feedback.qml</file>
<file>qml/Controls/Slider.qml</file>
<file>qml/Create/Create.qml</file>
<file>qml/Create/CreateNew.qml</file>
<file>qml/Create/CreateUpload.qml</file>
@ -85,21 +84,12 @@
<file>qml/Create/CreateWidget.qml</file>
<file>qml/Create/CreateWidgetButton.qml</file>
<file>qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml</file>
<file>qml/FileDropper.qml</file>
<file>qml/FileDropperSingleFile.qml</file>
<file>qml/Installed/Installed.qml</file>
<file>qml/Installed/InstalledNavigation.qml</file>
<file>qml/Installed/InstalledUserHelper.qml</file>
<file>qml/Installed/ScreenPlayItem.qml</file>
<file>qml/Installed/ScreenPlayItemImage.qml</file>
<file>qml/Installed/Sidebar.qml</file>
<file>qml/MonitorSelection.qml</file>
<file>qml/MonitorSelectionItem.qml</file>
<file>qml/Monitors.qml</file>
<file>qml/MonitorsProjectSettingItem.qml</file>
<file>qml/Navigation.qml</file>
<file>qml/NavigationItem.qml</file>
<file>qml/NavigationWallpaperConfiguration.qml</file>
<file>qml/Settings/SettingBool.qml</file>
<file>qml/Settings/Settings.qml</file>
<file>qml/Settings/SettingsButton.qml</file>
@ -107,7 +97,6 @@
<file>qml/Settings/SettingsExpander.qml</file>
<file>qml/Settings/SettingsHeader.qml</file>
<file>qml/Settings/SettingsHorizontalSeperator.qml</file>
<file>qml/Widgets/Window.qml</file>
<file>qml/Workshop/Workshop.qml</file>
<file>qtquickcontrols2.conf</file>
<file>settings.json</file>
@ -115,7 +104,6 @@
<file>translations/ScreenPlay_en.qm</file>
<file>qml/Screen/Screen.qml</file>
<file>assets/icons/icon_screen.svg</file>
<file>qml/Background.qml</file>
<file>qml/Community/XMLNewsfeed.qml</file>
<file>qml/Workshop/WorkshopAvailableTest.qml</file>
<file>qml/Workshop/WorkshopLoader.qml</file>
@ -125,5 +113,15 @@
<file>qml/Common/Tag.qml</file>
<file>assets/icons/icon_close.svg</file>
<file>qml/Common/ImageSelector.qml</file>
<file>qml/Common/Slider.qml</file>
<file>qml/Monitors/Monitors.qml</file>
<file>qml/Monitors/MonitorSelection.qml</file>
<file>qml/Monitors/MonitorSelectionItem.qml</file>
<file>qml/Monitors/MonitorsProjectSettingItem.qml</file>
<file>qml/Common/Background.qml</file>
<file>qml/Navigation/Navigation.qml</file>
<file>qml/Navigation/NavigationItem.qml</file>
<file>qml/Navigation/NavigationWallpaperConfiguration.qml</file>
<file>qml/Common/RippleEffect.qml</file>
</qresource>
</RCC>

View File

@ -4,28 +4,32 @@ CONFIG += c++17
#CONFIG += qtquickcompiler
#DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT
msvc: LIBS += -luser32
TARGETPATH = ScreenPlay
ICON = favicon.ico
DEFINES += QT_DEPRECATED_WARNINGS
DISTFILES += \
favicon.ico \
RESOURCES += Resources.qrc
SOURCES += main.cpp \
src/createimportvideo.cpp \
src/installedlistmodel.cpp \
src/monitorlistmodel.cpp \
src/screenplaywallpaper.cpp \
src/screenplaywidget.cpp \
src/settings.cpp \
src/profilelistmodel.cpp \
src/profile.cpp \
src/projectfile.cpp \
src/installedlistfilter.cpp \
src/sdkconnector.cpp \
src/projectsettingslistitem.cpp \
src/projectsettingslistmodel.cpp \
src/screenplay.cpp \
src/screenplaymanager.cpp \
src/qmlutilities.cpp \
src/create.cpp
RESOURCES += Resources.qrc
TRANSLATIONS = translations/ScreenPlay_en.ts \
translations/ScreenPlay_de.ts
@ -34,6 +38,8 @@ HEADERS += \
src/createimportvideo.h \
src/installedlistmodel.h \
src/monitorlistmodel.h \
src/screenplaywallpaper.h \
src/screenplaywidget.h \
src/settings.h \
src/profilelistmodel.h \
src/profile.h \
@ -42,7 +48,7 @@ HEADERS += \
src/sdkconnector.h \
src/projectsettingslistitem.h \
src/projectsettingslistmodel.h \
src/screenplay.h \
src/screenplaymanager.h \
src/qmlutilities.h \
src/create.h
@ -54,43 +60,21 @@ CONFIG(debug, debug|release) {
install_it.path = $${OUT_PWD}/debug/
} else {
install_it.path = $${OUT_PWD}/release/
}
}
install_it.files += assets/templates/config.json \
assets/icons/favicon.ico
win32 {
install_it.files += ThirdParty/ffmpeg/Windows/avcodec-58.dll \
ThirdParty/ffmpeg/Windows/avdevice-58.dll \
ThirdParty/ffmpeg/Windows/avfilter-7.dll \
ThirdParty/ffmpeg/Windows/avformat-58.dll \
ThirdParty/ffmpeg/Windows/avutil-56.dll \
ThirdParty/ffmpeg/Windows/ffmpeg.exe \
ThirdParty/ffmpeg/Windows/ffplay.exe \
ThirdParty/ffmpeg/Windows/ffprobe.exe \
ThirdParty/ffmpeg/Windows/postproc-55.dll \
ThirdParty/ffmpeg/Windows/swresample-3.dll \
ThirdParty/ffmpeg/Windows/swscale-5.dll \
ThirdParty/OpenSSL/libeay32.dll \
ThirdParty/OpenSSL/ssleay32.dll \
LIBS += -luser32
install_it.files += \
Common/vcpkg/packages/openssl-windows_x64-windows/bin/libeay32.dll \
Common/vcpkg/packages/openssl-windows_x64-windows/bin/ssleay32.dll \
}
INSTALLS += install_it
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
# QML_DESIGNER_IMPORT_PATH =
QT_QUICK_CONTROLS_STYLE = "Material"
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
macx: {
macx {
LIBS += -L$$PWD/ThirdParty/steam/redistributable_bin/osx32/ -lsteam_api
DEPENDPATH += $$PWD/ThirdParty/steam/redistributable_bin/osx32
@ -108,6 +92,5 @@ macx: {
}
DISTFILES += \
favicon.ico \
INSTALLS += install_it

View File

@ -1,5 +1,4 @@
#include <QDir>
#include <QFontDatabase>
#include <QGuiApplication>
#include <QIcon>
#include <QObject>
@ -10,21 +9,35 @@
#include <QUrl>
#include <QtWebEngine>
#include <memory>
#include "src/create.h"
#include "src/installedlistfilter.h"
#include "src/installedlistmodel.h"
#include "src/monitorlistmodel.h"
#include "src/profilelistmodel.h"
#include "src/qmlutilities.h"
#include "src/screenplay.h"
#include "src/screenplaymanager.h"
#include "src/sdkconnector.h"
#include "src/settings.h"
using std::shared_ptr,
std::make_shared,
ScreenPlay::QMLUtilities,
ScreenPlay::InstalledListModel,
ScreenPlay::ScreenPlayManager,
ScreenPlay::InstalledListFilter,
ScreenPlay::MonitorListModel,
ScreenPlay::ProfileListModel,
ScreenPlay::SDKConnector,
ScreenPlay::Settings,
ScreenPlay::Create;
int main(int argc, char* argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setOrganizationName("Aimber");
QGuiApplication::setOrganizationName("Kelteseth");
QGuiApplication::setOrganizationDomain("screen-play.app");
QGuiApplication::setApplicationName("ScreenPlay");
QGuiApplication::setApplicationVersion("0.2.0");
@ -39,55 +52,50 @@ int main(int argc, char* argv[])
// Qt < 6.0 needs this init QtWebEngine
QtWebEngine::initialize();
QFontDatabase::addApplicationFont(":/assets/fonts/LibreBaskerville-Italic.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Light.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Regular.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Thin.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Light.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Thin.ttf");
QMLUtilities qmlUtil;
InstalledListModel installedListModel;
InstalledListFilter installedListFilter(&installedListModel);
MonitorListModel monitorListModel;
ProfileListModel profileListModel;
SDKConnector sdkConnector;
auto installedListModel = make_shared<InstalledListModel>();
auto installedListFilter = make_shared<InstalledListFilter>(installedListModel);
auto monitorListModel = make_shared<MonitorListModel>();
auto profileListModel = make_shared<ProfileListModel>();
auto sdkConnector = make_shared<SDKConnector>();
// Create settings in the end because for now it depends on
// such things as the profile list model to complete
// It will also set the m_absoluteStoragePath in profileListModel and installedListModel
Settings settings(&profileListModel, &monitorListModel, &installedListModel, &sdkConnector);
ScreenPlay screenPlay(&installedListModel, &settings, &monitorListModel, &sdkConnector);
Create create(&settings, &qmlUtil);
auto settings = make_shared<Settings>(installedListModel, profileListModel, monitorListModel, sdkConnector);
ScreenPlayManager screenPlay(installedListModel, settings, monitorListModel, sdkConnector);
Create create(settings);
// All the list need the default path from the settings
// to know where to look for the files
profileListModel.loadProfiles();
settings.loadActiveProfiles();
profileListModel->loadProfiles();
settings->loadActiveProfiles();
QQmlApplicationEngine mainWindowEngine;
mainWindowEngine.rootContext()->setContextProperty("screenPlay", &screenPlay);
mainWindowEngine.rootContext()->setContextProperty("screenPlayCreate", &create);
mainWindowEngine.rootContext()->setContextProperty("utility", &qmlUtil);
mainWindowEngine.rootContext()->setContextProperty("installedListFilter", &installedListFilter);
mainWindowEngine.rootContext()->setContextProperty("monitorListModel", &monitorListModel);
mainWindowEngine.rootContext()->setContextProperty("installedListModel", &installedListModel);
mainWindowEngine.rootContext()->setContextProperty("profileListModel", &profileListModel);
mainWindowEngine.rootContext()->setContextProperty("screenPlaySettings", &settings);
mainWindowEngine.rootContext()->setContextProperty("installedListFilter", installedListFilter.get());
mainWindowEngine.rootContext()->setContextProperty("monitorListModel", monitorListModel.get());
mainWindowEngine.rootContext()->setContextProperty("installedListModel", installedListModel.get());
mainWindowEngine.rootContext()->setContextProperty("profileListModel", profileListModel.get());
mainWindowEngine.rootContext()->setContextProperty("screenPlaySettings", settings.get());
mainWindowEngine.load(QUrl(QStringLiteral("qrc:/main.qml")));
installedListModel.loadInstalledContent();
installedListModel->loadInstalledContent();
// Instead of setting "renderType: Text.NativeRendering" every time
// we can set it here once :)
auto* window = static_cast<QQuickWindow*>(mainWindowEngine.rootObjects().first());
if (!window)
qFatal("Could not receive window to set font rendering.");
window->setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
// Set visible if the -silent parameter was not set
QStringList argumentList = app.arguments();
if (!argumentList.contains("-silent")) {
settings.setMainWindowVisible(true);
settings->setMainWindowVisible(true);
}
return app.exec();

View File

@ -5,14 +5,16 @@ import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import Qt.labs.platform 1.0
import "qml/"
import "qml/Monitors"
import "qml/Common"
import "qml/Installed"
import "qml/Navigation"
ApplicationWindow {
id: window
color: "#eeeeee"
// Set visible if the -silent parameter was not set
// Set visible if the -silent parameter was not set (see main.cpp:87).
visible: false
width: 1400
title: "ScreenPlay 0.2"

View File

@ -0,0 +1,111 @@
/*
* Based on:
* https://github.com/rschiang/material
* (THE BSD 2-CLAUSE LICENSE)
*/
import QtQuick 2.0
import QtGraphicalEffects 1.0
Item {
id: control
anchors.fill: parent
property alias radius: mask.radius
property color color: "#de000000"
property var target
property int duration: 600
function trigger() {
var wave = ripple.createObject(container, {
"startX": control.width * .5,
"startY": control.height * .5,
"maxRadius": furthestDistance(
control.width * .5,
control.height * .5)
})
}
Rectangle {
id: mask
anchors.fill: parent
color: "black"
visible: false
}
Item {
id: container
anchors.fill: parent
visible: false
}
OpacityMask {
anchors.fill: parent
source: container
maskSource: mask
}
Component {
id: ripple
Rectangle {
id: ink
radius: 0
opacity: 0.25
color: control.color
property int startX
property int startY
property int maxRadius: 150
x: startX - radius
y: startY - radius
width: radius * 2
height: radius * 2
NumberAnimation {
id: growAnimation
target: ink
property: "radius"
from: 0
to: maxRadius
duration: 550
easing.type: Easing.OutCubic
}
SequentialAnimation {
id: fadeAnimation
NumberAnimation {
target: ink
property: "opacity"
from: 0.25
to: 0
duration: control.duration
}
ScriptAction {
script: ink.destroy()
}
}
Component.onCompleted: {
growAnimation.start()
if (!fadeAnimation.running)
fadeAnimation.start()
}
function fadeIfApplicable() {
if (!fadeAnimation.running)
fadeAnimation.start()
}
}
}
function distance(x1,y1,x2,y2) {
return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2))
}
function furthestDistance(x,y) {
return Math.max(distance(x, y, 0, 0), distance(x, y, width, height),
distance(x, y, 0, height), distance(x, y, width, 0))
}
}

View File

@ -224,7 +224,7 @@ Item {
icon.width: 16
icon.height: 16
onClicked: Qt.openUrlExternally(
"https://gitlab.com/aimber/ScreenPlay/")
"https://gitlab.com/kelteseth/ScreenPlay/")
}
Button {
text: qsTr("Workshop")

View File

@ -1,5 +0,0 @@
import QtQuick 2.0
Item {
}

View File

@ -1,5 +0,0 @@
import QtQuick 2.0
Item {
}

View File

@ -4,7 +4,7 @@ import QtQuick.Controls.Material 2.2
import QtQuick.Particles 2.0
import QtGraphicalEffects 1.0
import net.aimber.create 1.0
import ScreenPlay.Create 1.0
import "Wizards/CreateWallpaper"
@ -237,7 +237,7 @@ Item {
icon.width: 16
icon.height: 16
onClicked: Qt.openUrlExternally(
"https://aimber.gitlab.io/ScreenPlayDocs/")
"https://kelteseth.gitlab.io/ScreenPlayDocs/")
}
Button {
text: qsTr("Forums")

View File

@ -4,7 +4,7 @@ import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0
import QtQuick.Layouts 1.3
import net.aimber.create 1.0
import ScreenPlay.Create 1.0
Item {
id: wrapperError

View File

@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0
import QtQuick.Layouts 1.12
import net.aimber.create 1.0
import ScreenPlay.Create 1.0
import "../../../Common"

View File

@ -5,7 +5,7 @@ import QtQuick.Controls.Material 2.3
import Qt.labs.platform 1.0
import QtQuick.Layouts 1.3
import net.aimber.create 1.0
import ScreenPlay.Create 1.0
Item {
id: createNew

View File

@ -1,117 +0,0 @@
import QtQuick 2.12
import QtQuick.Extras 1.4
import PackageFileHandler 1.0
DropArea {
id:dropper
state:"invisible"
onEntered: {
dropper.state = "visible"
}
onExited: {
dropper.state = "invisible"
}
Connections {
target: packageFileHandler
onCurrentLoaderStatusChanged:{
}
}
onDropped: {
var a= packageFileHandler.loadPackageFromLocalZip(drop.urls,".")
if(a === -1) {
dropper.state = "badFile"
timer.start()
} else if(a === 0){
dropper.state = "invisible"
}
}
Timer {
id:timer
interval: 1000
onTriggered: {
dropper.state = "invisible"
timer.stop()
}
}
Rectangle {
id:fill
anchors.fill: parent
opacity: .8
Picture {
id: picture
x: 332
y: 208
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
source: "qrc://assets/icons/icon_settings.svg"
}
}
Text {
id: text1
text: qsTr("Bad File!!")
font.pointSize: 24
opacity: 1
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
states: [
State {
name: "visible"
},
State {
name: "invisible"
PropertyChanges {
target: fill
opacity: 0
}
PropertyChanges {
target: text1
opacity: 0
}
},
State {
name: "badFile"
}
]
transitions: [
Transition {
from: "*"
to: "invisible"
NumberAnimation {
target: fill
property: "opacity"
duration: 200
easing.type: Easing.OutQuart
}
},
Transition {
from: "invisible"
to: "visible"
NumberAnimation {
target: fill
property: "opacity"
duration: 200
easing.type: Easing.OutQuart
}
}
]
}

View File

@ -1,225 +0,0 @@
import QtQuick 2.12
import QtQuick.Dialogs 1.2
Rectangle {
id: fileDropperSingleFile
property color background: "white"
property string descriptionTitle: "value"
property url imagePath: "qrc:/assets/icons/icon_plus.svg"
//FIXME in 5.10 with an enum
property bool isVideo: false
property url externalFilePath
property string helpText: "help"
color: fileDropperSingleFile.background
border.color: "#C2C2C2"
border.width: 2
radius: 4
state: ""
function reset(){
fileDropperSingleFile.state = "empty"
previewImage.source = ""
videoPreviewLoader.source = ""
}
onStateChanged: {
if (fileDropperSingleFile.state === "error") {
stateChangedTimer.start()
}
}
Timer {
id: stateChangedTimer
onTriggered: {
fileDropperSingleFile.state = "empty"
}
}
Image {
id: previewImage
anchors.fill: parent
anchors.margins: 2
z: 98
fillMode: Image.PreserveAspectCrop
visible: false
}
Item {
id: column
height: imageIcon.height + txtSplashInput.contentHeight
anchors {
right: parent.right
left: parent.left
verticalCenter: parent.verticalCenter
}
Image {
id: imageIcon
width: 32
height: 32
sourceSize.height: 32
sourceSize.width: 32
source: fileDropperSingleFile.imagePath
anchors {
top: parent.top
horizontalCenter: parent.horizontalCenter
}
}
Text {
id: txtSplashInput
text: descriptionTitle
anchors {
top: imageIcon.bottom
topMargin: 10
horizontalCenter: parent.horizontalCenter
}
height: 40
font.pointSize: 12
color: "#626262"
horizontalAlignment: Text.AlignHCenter
font.family: "Libre Baskerville"
font.italic: true
}
}
Text {
id: helpTextWrapper
color: "#626262"
anchors.fill: parent
anchors.margins: 20
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: "Libre Baskerville"
font.italic: true
wrapMode: Text.WordWrap
font.pointSize: 12
opacity: 0
text: helpText
}
DropArea {
id: dropper
anchors.fill: parent
focus: true
onEntered: {
fileDropperSingleFile.state = "fileEntered"
}
onDropped: {
fileDropperSingleFile.state = "fileDropped"
if (drop.hasUrls) {
if (isVideo) {
if (validateVideoFileExtension(drop.urls[0])) {
externalFilePath = drop.urls[0]
videoPreviewLoader.setSource(
"CreateVideoPreviewSmall.qml", {
source: externalFilePath
})
}
} else {
if (validateImageFileExtension(drop.urls[0])) {
externalFilePath = drop.urls[0]
previewImage.source = drop.urls[0]
previewImage.visible = true
}
}
}
}
onExited: {
fileDropperSingleFile.state = "empty"
}
function validateImageFileExtension(filePath) {
var tmp = filePath.split('.').pop()
return tmp === "png" || tmp === "jpg"
}
function validateVideoFileExtension(filePath) {
var tmp = filePath.split('.').pop()
return tmp === "vp9" || tmp === "mp4"
}
MouseArea {
anchors.fill: parent
focus: true
z: 99
hoverEnabled: true
onHoveredChanged: {
if (containsMouse && videoPreviewLoader.source.toString() === "") {
fileDropperSingleFile.state = "hover"
} else {
fileDropperSingleFile.state = ""
}
}
}
}
Loader {
id: videoPreviewLoader
asynchronous: true
anchors.fill: parent
anchors.margins: 2
z: 300
}
states: [
State {
name: "fileEntered"
PropertyChanges {
target: fileDropperSingleFile
color: "#d9d9d9"
}
},
State {
name: "fileDropped"
PropertyChanges {
target: fileDropperSingleFile
color: "#ffbf49"
}
},
State {
name: "empty"
PropertyChanges {
target: fileDropperSingleFile
color: "white"
}
},
State {
name: "error"
PropertyChanges {
target: fileDropperSingleFile
color: "#ff4d4d"
}
},
State {
name: "hover"
PropertyChanges {
target: column
opacity: 0
}
PropertyChanges {
target: helpTextWrapper
opacity: 1
}
}
]
transitions: [
Transition {
from: "*"
to: "*"
ColorAnimation {
duration: 200
}
NumberAnimation {
property: "opacity"
duration: 200
}
}
]
}

View File

@ -139,16 +139,13 @@ Item {
id: screenPlayItemImage
anchors.fill: parent
sourceImage: Qt.resolvedUrl(
screenPlayItem.absoluteStoragePath
+ "/" + screenPreview)
screenPlayItem.absoluteStoragePath + "/" + screenPreview)
sourceImageGIF: {
if (screenPreviewGIF === undefined) {
return ""
} else {
return Qt.resolvedUrl(
screenPlayItem.absoluteStoragePath
+ "/" + screenPreviewGIF)
screenPlayItem.absoluteStoragePath + "/" + screenPreviewGIF)
}
}
}
@ -176,7 +173,6 @@ Item {
left: parent.left
bottom: parent.bottom
}
}
}

View File

@ -4,7 +4,7 @@ import QtQuick.Controls 2.3
import QtQuick.Extras 1.4
import QtQuick.Controls.Material 2.2
import "../"
import "../Monitors"
Item {
id: sidebar

View File

@ -4,7 +4,7 @@ import QtGraphicalEffects 1.0
import QtQuick.Controls.Material 2.2
import QtQuick.Layouts 1.3
import "Controls/" as SP
import "../Common/" as SP
Item {
id: monitors

View File

@ -2,8 +2,8 @@ import QtQuick 2.12
import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0
import "Workshop"
import "../Workshop"
import "../Common"
Rectangle {
id: navigation
@ -14,7 +14,7 @@ Rectangle {
signal changePage(string name)
property var navArray: [navCreate, navWorkshop, navInstalled, navSettings, navCommunity, navScreen]
property var navArray: [navCreate, navWorkshop, navInstalled, navSettings, navCommunity]
property bool navActive: true
Connections {
@ -40,7 +40,8 @@ Rectangle {
navigation.changePage(name)
for (var i = 0; i < navArray.length; i++) {
var i = 0
for (; i < navArray.length; i++) {
if (navArray[i].name === name)
navArray[i].state = "active"
else {
@ -50,7 +51,7 @@ Rectangle {
}
WorkshopLoader {
id:wl
id: wl
}
Row {
@ -86,14 +87,6 @@ Rectangle {
onPageClicked: navigation.onPageChanged(name)
}
NavigationItem {
id: navScreen
state: "inactive"
name: "Screen"
iconSource: "qrc:/assets/icons/icon_screen.svg"
onPageClicked: navigation.onPageChanged(name)
}
NavigationItem {
id: navCommunity
state: "inactive"

View File

@ -2,22 +2,37 @@ import QtQuick 2.12
import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0
import "../Common"
Item {
id: navigationWallpaperConfiguration
width: 400
width: 450
anchors {
top: parent.top
right: parent.right
rightMargin: 30
bottom: parent.bottom
}
RippleEffect {
id:rippleEffect
target: navigationWallpaperConfiguration
}
Connections {
target: screenPlaySettings
onActiveWallpaperCounterChanged:{
rippleEffect.trigger()
}
}
Image {
id: image
width: 24
height: 24
anchors {
rightMargin: 30
right: parent.right
verticalCenter: parent.verticalCenter
}
@ -62,7 +77,7 @@ Item {
font.family: "Roboto"
}
MouseArea {
id: mouseArea
id: ma
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {

View File

@ -394,7 +394,7 @@ Item {
description: qsTr("ScreenPlay would not be possible without the work of others. A big thank you to: ")
buttonText: qsTr("Licenses")
onButtonPressed: {
screenPlaySettings.requestAllLicenses()
utility.requestAllLicenses()
expanderCopyright.toggle()
}
}
@ -407,7 +407,7 @@ Item {
Connections {
target: screenPlaySettings
target: utility
onAllLicenseLoaded: {
expanderCopyright.text = licensesText
}
@ -420,7 +420,7 @@ Item {
description: qsTr("We use you data very carefully to improve ScreenPlay. We do not sell or share this (anonymous) information with others!")
buttonText: qsTr("Privacy")
onButtonPressed: {
screenPlaySettings.requestAllLDataProtection()
utility.requestAllLDataProtection()
expanderDataProtection.toggle()
}
}
@ -433,7 +433,7 @@ Item {
Connections {
target: screenPlaySettings
target: utility
onAllDataProtectionLoaded: {
expanderDataProtection.text = dataProtectionText
}

View File

@ -1,59 +0,0 @@
import QtQuick 2.12
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtQuick.Window 2.0
Window {
id: mainWindow
visible: true
width: 640
height: 480
//color: "transparent"
flags: Qt.SplashScreen | Qt.ToolTip | Qt.WindowStaysOnBottomHint
Rectangle {
id: rectangle
anchors.fill: parent;
color: "#b31f2934"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Text {
id: text1
color: "#ffffff"
text: "empty"
font.pointSize: 29
}
}
MouseArea {
property variant clickPos: "1,1"
anchors.fill: parent;
onPressed: {
clickPos = Qt.point(mouse.x,mouse.y)
}
onPositionChanged: {
var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y)
var new_x = mainWindow.x + delta.x
var new_y = mainWindow.y + delta.y
if (new_y <= 0)
mainWindow.visibility = Window.Maximized
else
{
if (mainWindow.visibility === Window.Maximized)
mainWindow.visibility = Window.Windowed
mainWindow.x = new_x
mainWindow.y = new_y
}
}
}
}

View File

@ -2,7 +2,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.2
import QtGraphicalEffects 1.0
import net.aimber.workshop 1.0
import ScreenPlay.Workshop 1.0
Item {
id: workshop

View File

@ -1,5 +1,5 @@
import QtQuick 2.12
import net.aimber.workshop 1.0
import ScreenPlay.Workshop 1.0
Item {

View File

@ -5,6 +5,6 @@
"sendStatistics" : false,
"absoluteStoragePath": "",
"profiles":[
{ "monitorID": "","profile": "" }
{ "monitorID": "","wallpaper": "" }
]
}

View File

@ -1,15 +1,33 @@
#include "create.h"
Create::Create(Settings* st, QMLUtilities* util, QObject* parent)
/*!
\class Create
\since 1.0
\brief Baseclass for creating wallapers, widgets and the corresponding
wizards. As for this writing (April 2019) it is solely used to
import webm wallpaper and create the gif/web 5 second previews.
\todo
- This class would need to be refactored to be used in more creation types.
*/
namespace ScreenPlay {
Create::Create(const shared_ptr<Settings>& settings, QObject* parent)
: QObject(parent)
, m_settings(settings)
{
m_settings = st;
m_utils = util;
qRegisterMetaType<CreateImportVideo::State>();
qmlRegisterType<Create>("net.aimber.create", 1, 0, "Create");
qmlRegisterType<CreateImportVideo>("net.aimber.create", 1, 0, "CreateImportVideo");
qmlRegisterType<Create>("ScreenPlay.Create", 1, 0, "Create");
qmlRegisterType<CreateImportVideo>("ScreenPlay.Create", 1, 0, "CreateImportVideo");
}
// Constructor for the QMLEngine
Create::Create()
: QObject(nullptr)
, m_settings(nullptr)
{
qRegisterMetaType<CreateImportVideo::State>();
qmlRegisterType<Create>("ScreenPlay.Create", 1, 0, "Create");
qmlRegisterType<CreateImportVideo>("ScreenPlay.Create", 1, 0, "CreateImportVideo");
}
void Create::createWallpaperStart(QString videoPath)
@ -127,3 +145,4 @@ void Create::abortAndCleanup()
});
m_createImportVideoThread->requestInterruption();
}
}

View File

@ -26,15 +26,12 @@
#include "qmlutilities.h"
#include "settings.h"
/*!
\class Create
\since 1.0
\brief Baseclass for creating wallapers, widgets and the corresponding
wizards. As for this writing (April 2019) it is solely used to
import webm wallpaper and create the gif/web 5 second previews.
\todo
- This class would need to be refactored to be used in more creation types.
*/
namespace ScreenPlay {
using std::shared_ptr,
std::make_shared;
class Create : public QObject {
Q_OBJECT
@ -43,9 +40,9 @@ class Create : public QObject {
Q_PROPERTY(float progress READ progress WRITE setProgress NOTIFY progressChanged)
public:
explicit Create(Settings* st, QMLUtilities* util, QObject* parent = nullptr);
Create() {}
explicit Create(const shared_ptr<Settings>& settings,
QObject* parent = nullptr);
Create();
~Create() {}
float progress() const
@ -90,10 +87,11 @@ public slots:
private:
CreateImportVideo* m_createImportVideo;
Settings* m_settings;
QThread* m_createImportVideoThread;
QMLUtilities* m_utils;
const shared_ptr<Settings> m_settings;
float m_progress = 0.0f;
QString m_workingDir;
};
}

View File

@ -1,12 +1,25 @@
#include "createimportvideo.h"
#include <QScopeGuard>
namespace ScreenPlay {
/*!
\class CreateImportVideo
\brief This class imports (copies) and creates wallaper previews. This
class only exsits as long as the user creates a wallpaper and gets
destroyed if the creation was successful or not.
The state get propagated via createWallpaperStateChanged(CreateImportVideo::State state);
\todo
- Maybe: Replace with QThread to avoid running QCoreApplication::processEvents();?
*/
CreateImportVideo::CreateImportVideo(QObject* parent)
: QObject(parent)
{
}
CreateImportVideo::CreateImportVideo(QString videoPath, QString exportPath, QObject* parent)
CreateImportVideo::CreateImportVideo(const QString& videoPath, const QString& exportPath, QObject* parent)
: QObject(parent)
{
m_videoPath = videoPath;
@ -101,7 +114,7 @@ bool CreateImportVideo::createWallpaperInfo()
// Get framerate
QJsonArray arrSteams = obj.value("streams").toArray();
if (arrSteams.size() < 1) {
if (arrSteams.empty()) {
qDebug() << "Error container does not have any video streams";
return false;
}
@ -359,4 +372,4 @@ bool CreateImportVideo::extractWallpaperAudio()
return true;
}
}

View File

@ -14,26 +14,16 @@
#include <QString>
#include <QThread>
#include <QtMath>
#include <QScopeGuard>
/*!
\class CreateImportVideo
\brief This class imports (copies) and creates wallaper previews. This
class only exsits as long as the user creates a wallpaper and gets
destroyed if the creation was successful or not.
The state get propagated via createWallpaperStateChanged(CreateImportVideo::State state);
\todo
- Maybe: Replace with QThread to avoid running QCoreApplication::processEvents();?
*/
namespace ScreenPlay {
class CreateImportVideo : public QObject {
Q_OBJECT
public:
CreateImportVideo(QObject* parent = nullptr);
explicit CreateImportVideo(QString videoPath, QString exportPath, QObject* parent = nullptr);
explicit CreateImportVideo(const QString& videoPath, const QString& exportPath, QObject* parent = nullptr);
enum class State {
Idle,
@ -91,3 +81,4 @@ public slots:
bool createWallpaperImagePreview();
bool extractWallpaperAudio();
};
}

View File

@ -1,9 +1,20 @@
#include "installedlistfilter.h"
InstalledListFilter::InstalledListFilter(InstalledListModel* ilm)
{
/*!
\class Installed List Filder
\brief Proxy between Installed List Model and QML view to filter items.
Maybe this class could be merged with the InstalledListModel...
setSourceModel(ilm);
\todo
- Expand filter functionality
*/
namespace ScreenPlay {
InstalledListFilter::InstalledListFilter(const shared_ptr<InstalledListModel>& ilm)
: QSortFilterProxyModel()
, m_ilm(ilm)
{
setSourceModel(m_ilm.get());
setFilterRole(InstalledListModel::InstalledRole::TitleRole);
sortByRoleType("All");
}
@ -19,7 +30,8 @@ void InstalledListFilter::sortByRoleType(QString type)
} else if (type == "Widgets") {
setFilterRole(InstalledListModel::InstalledRole::TypeRole);
setFilterFixedString("widget");
} if (type == "Scenes") {
}
if (type == "Scenes") {
setFilterRole(InstalledListModel::InstalledRole::TypeRole);
setFilterFixedString("qmlScene");
}
@ -41,3 +53,4 @@ void InstalledListFilter::resetFilter()
setFilterWildcard("*");
sort(0);
}
}

View File

@ -2,27 +2,22 @@
#include <QRegExp>
#include <QSortFilterProxyModel>
#include <memory>
#include "installedlistmodel.h"
/*!
\class Installed List Filder
\brief Proxy between Installed List Model and QML view to filter items.
Maybe this class could be merged with the InstalledListModel...
\todo
- Expand filter functionality
*/
namespace ScreenPlay {
using std::shared_ptr;
class InstalledListFilter : public QSortFilterProxyModel {
Q_OBJECT
public:
InstalledListFilter(InstalledListModel* ilm);
InstalledListFilter(const shared_ptr<InstalledListModel>& ilm);
public slots:
void sortByRoleType(QString type);
void sortByName(QString name);
void resetFilter();
private:
const shared_ptr<InstalledListModel> m_ilm;
};
}

View File

@ -1,5 +1,15 @@
#include "installedlistmodel.h"
/*!
\class Installed List Model
\brief Lists all installed wallpapers, widgets etc. from a given Path
*/
namespace ScreenPlay {
InstalledListModel::InstalledListModel(QObject* parent)
: QAbstractListModel(parent)
{
@ -177,3 +187,4 @@ void InstalledListModel::reset()
m_screenPlayFiles.squeeze();
endResetModel();
}
}

View File

@ -1,7 +1,5 @@
#pragma once
#include "profilelistmodel.h"
#include "projectfile.h"
#include <QAbstractListModel>
#include <QByteArray>
#include <QDebug>
@ -19,11 +17,11 @@
#include <QVector>
#include <QtConcurrent/QtConcurrent>
/*!
\class Installed List Model
\brief Lists all installed wallpapers, widgets etc. from a given Path
*/
#include "profilelistmodel.h"
#include "projectfile.h"
namespace ScreenPlay {
class InstalledListModel : public QAbstractListModel {
Q_OBJECT
@ -65,7 +63,7 @@ public slots:
QVariantMap get(QString folderId);
void setabsoluteStoragePath(QUrl absoluteStoragePath)
void setabsoluteStoragePath(const QUrl& absoluteStoragePath)
{
if (m_absoluteStoragePath == absoluteStoragePath)
return;
@ -85,3 +83,4 @@ private:
QVector<ProjectFile> m_screenPlayFiles;
QUrl m_absoluteStoragePath;
};
}

View File

@ -1,10 +1,11 @@
#include "monitorlistmodel.h"
namespace ScreenPlay {
MonitorListModel::MonitorListModel(QObject* parent)
: QAbstractListModel(parent)
, m_qGuiApplication(static_cast<QGuiApplication*>(QGuiApplication::instance()))
{
loadMonitors();
m_qGuiApplication = static_cast<QGuiApplication*>(QGuiApplication::instance());
connect(m_qGuiApplication, &QGuiApplication::screenAdded, this, &MonitorListModel::screenAdded);
connect(m_qGuiApplication, &QGuiApplication::screenRemoved, this, &MonitorListModel::screenRemoved);
}
@ -128,26 +129,16 @@ void MonitorListModel::wallpaperRemoved()
{
}
bool MonitorListModel::getMonitorListItemAt(int position, Monitor* monitor)
{
//TODO Reimplement wallpaper replacement
// if (position < 0 && position > m_monitorList.size()) {
// return false;
// } else {
// *monitor = m_monitorList.at(position);
// return true;
// }
return true;
}
void MonitorListModel::screenAdded(QScreen* screen)
{
Q_UNUSED(screen)
reset();
loadMonitors();
}
void MonitorListModel::screenRemoved(QScreen* screen)
{
Q_UNUSED(screen)
reset();
loadMonitors();
}
@ -186,10 +177,6 @@ void MonitorListModel::reloadMonitors()
loadMonitors();
}
Monitor::Monitor()
{
}
Monitor::Monitor(QString manufacturer, QString model, QString name, QSize size, QRect availableGeometry, int number, QRect availableVirtualGeometry, QRect geometry, QScreen* screen)
{
m_screen = screen;
@ -205,3 +192,4 @@ Monitor::Monitor(QString manufacturer, QString model, QString name, QSize size,
// because name and manufacturer are allways empty
m_id = name + "_" + QString::number(size.width()) + "x" + QString::number(size.height()) + "_" + QString::number(availableGeometry.x()) + "x" + QString::number(availableGeometry.y());
}
}

View File

@ -20,7 +20,7 @@
- Add event when monitor count changed.
*/
namespace ScreenPlay {
struct Monitor;
class MonitorListModel : public QAbstractListModel {
@ -32,7 +32,7 @@ public:
QHash<int, QByteArray> roleNames() const override;
enum MonitorRole {
IDRole,
IDRole = Qt::UserRole,
NameRole,
SizeRole,
AvailableGeometryRole,
@ -49,7 +49,6 @@ public:
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
bool getMonitorListItemAt(int position, Monitor* monitor);
void loadMonitors();
void screenAdded(QScreen* screen);
void screenRemoved(QScreen* screen);
@ -65,7 +64,7 @@ public slots:
private:
QVector<Monitor> m_monitorList;
QGuiApplication* m_qGuiApplication;
const QGuiApplication* const m_qGuiApplication;
QVector<QSharedPointer<ProjectSettingsListModel>> m_plm;
signals:
@ -75,7 +74,7 @@ signals:
struct Monitor {
Monitor();
Monitor() {}
Monitor(QString manufacturer, QString model, QString name, QSize size, QRect availableGeometry, int number, QRect availableVirtualGeometry, QRect geometry, QScreen* screen);
QString m_id;
@ -94,3 +93,4 @@ struct Monitor {
QScreen* m_screen = nullptr;
};
}

View File

@ -1,17 +0,0 @@
#include "profile.h"
Profile::Profile()
{
}
Profile::Profile(QUrl absolutePath, QString id, QString version, QString wallpaperId, QRect rect, bool isLooping)
{
m_absolutePath = absolutePath;
m_id = id;
m_version = version;
m_wallpaperId = wallpaperId;
m_rect = rect;
m_isLooping = isLooping;
}

View File

@ -9,11 +9,24 @@
See Profile List Model for more details
*/
namespace ScreenPlay {
struct Profile {
Profile();
Profile(QUrl absolutePath, QString id, QString version, QString wallpaperId, QRect rect, bool isLooping);
Profile() {}
Profile(const QUrl& absolutePath,
const QString& id,
const QString& version,
const QString& wallpaperId,
const QRect& rect,
const bool isLooping)
{
m_absolutePath = absolutePath;
m_id = id;
m_version = version;
m_wallpaperId = wallpaperId;
m_rect = rect;
m_isLooping = isLooping;
}
QUrl m_absolutePath;
QString m_id;
@ -22,3 +35,4 @@ struct Profile {
QRect m_rect;
bool m_isLooping = true;
};
}

View File

@ -6,6 +6,8 @@
#include <QJsonObject>
#include <QPair>
namespace ScreenPlay {
ProfileListModel::ProfileListModel(QObject* parent)
: QAbstractListModel(parent)
{
@ -112,3 +114,4 @@ bool ProfileListModel::getProfileByName(QString id, Profile* profile)
}
return false;
}
}

View File

@ -17,7 +17,7 @@
- Add a profile for a combination of active wallpaper and widgets!
*/
namespace ScreenPlay {
struct Profile;
class ProfileListModel : public QAbstractListModel {
@ -42,3 +42,4 @@ private:
QHash<int, QByteArray> m_roleNames;
QVector<Profile> m_profileList;
};
}

View File

@ -1,51 +0,0 @@
#include "projectfile.h"
ProjectFile::ProjectFile(QJsonObject obj, QString folderName, QUrl absolutePath)
{
if (obj.contains("description"))
m_description = obj.value("description");
if (obj.contains("file"))
m_file = obj.value("file");
if (obj.contains("preview"))
m_preview = obj.value("preview");
if (obj.contains("previewGIF"))
m_previewGIF = obj.value("previewGIF");
if (obj.contains("title"))
m_title = obj.value("title");
if (obj.contains("type")) {
QString tmp = obj.value("type").toString().toLower();
if (tmp == "video") {
m_type = "video";
} else if (tmp == "qmlwidget" || tmp == "standalonewidget") {
m_type = "widget";
} else if (tmp == "qmlscene") {
m_type = "qmlScene";
} else if (tmp == "html") {
m_type = "html";
}
}
if (obj.contains("workshopid")) {
m_workshopID = obj.value("workshopid").toInt();
} else {
m_workshopID = 0;
}
m_absoluteStoragePath = QUrl(absolutePath.toString() + "/" + folderName);
m_folderId = folderName;
}
ProjectFile::ProjectFile()
{
}
ProjectFile::~ProjectFile()
{
}

View File

@ -11,12 +11,57 @@
\brief In ScreenPlay every Wallpaper, Scene or Widget has an project.json to store its configuration
*/
namespace ScreenPlay {
struct ProjectFile {
explicit ProjectFile(QJsonObject obj, QString folderName, QUrl absolutePath);
ProjectFile();
~ProjectFile();
ProjectFile(const QJsonObject& obj,
const QString& folderName,
const QUrl& absolutePath)
{
if (obj.contains("description"))
m_description = obj.value("description");
if (obj.contains("file"))
m_file = obj.value("file");
if (obj.contains("preview"))
m_preview = obj.value("preview");
if (obj.contains("previewGIF"))
m_previewGIF = obj.value("previewGIF");
if (obj.contains("title"))
m_title = obj.value("title");
if (obj.contains("type")) {
QString tmp = obj.value("type").toString().toLower();
if (tmp == "video") {
m_type = "video";
} else if (tmp == "qmlwidget" || tmp == "standalonewidget") {
m_type = "widget";
} else if (tmp == "qmlscene") {
m_type = "qmlScene";
} else if (tmp == "html") {
m_type = "html";
}
}
if (obj.contains("workshopid")) {
m_workshopID = obj.value("workshopid").toInt();
} else {
m_workshopID = 0;
}
m_absoluteStoragePath = QUrl(absolutePath.toString() + "/" + folderName);
m_folderId = folderName;
}
ProjectFile() {}
~ProjectFile() {}
QVariant m_description;
QVariant m_file;
@ -31,3 +76,4 @@ struct ProjectFile {
QVariantList m_tags; //TODO: Implement me!
};
}

View File

@ -1,19 +0,0 @@
#include "projectsettingslistitem.h"
ProjectSettingsListItem::ProjectSettingsListItem(QString name, bool isHeadline, QVariant value)
{
m_name = name;
m_isHeadline = isHeadline;
m_value = value;
}
ProjectSettingsListItem::ProjectSettingsListItem()
{
}
ProjectSettingsListItem::~ProjectSettingsListItem()
{
}

View File

@ -9,13 +9,23 @@
*/
namespace ScreenPlay {
struct ProjectSettingsListItem {
ProjectSettingsListItem(QString name, bool isHeadline, QVariant value);
ProjectSettingsListItem();
~ProjectSettingsListItem();
ProjectSettingsListItem(
const QString& name,
const bool isHeadline,
const QVariant& value)
{
m_name = name;
m_isHeadline = isHeadline;
m_value = value;
}
ProjectSettingsListItem() {}
~ProjectSettingsListItem() {}
QString m_name;
bool m_isHeadline;
QVariant m_value;
};
}

View File

@ -1,5 +1,5 @@
#include "projectsettingslistmodel.h"
namespace ScreenPlay {
ProjectSettingsListModel::ProjectSettingsListModel(QString file, QObject* parent)
: QAbstractListModel(parent)
{
@ -98,3 +98,4 @@ void ProjectSettingsListModel::append(QString name, bool isHeadline, QVariant va
endInsertRows();
}
}

View File

@ -17,7 +17,7 @@
\brief Reads the project.json for every Wallpaper, Scene or Widget "general" object and displays it for the user to modify
*/
namespace ScreenPlay {
class ProjectSettingsListModel : public QAbstractListModel {
Q_OBJECT
@ -29,7 +29,7 @@ public:
QHash<int, QByteArray> roleNames() const override;
enum ProjectSettingsRole {
NameRole,
NameRole = Qt::UserRole,
IsHeadlineRole,
ValueRole,
};
@ -43,3 +43,4 @@ public slots:
private:
QVector<ProjectSettingsListItem> m_projectSettings;
};
}

View File

@ -2,6 +2,17 @@
#include <QProcess>
namespace ScreenPlay {
/*!
\class Global QML Utilities
\brief Easy to use global object to use to:
\list
\i Navigate the main menu
\i Open Explorer at a given path
\endlist
*/
QMLUtilities::QMLUtilities(QObject* parent)
: QObject(parent)
{
@ -29,14 +40,73 @@ QString QMLUtilities::fixWindowsPath(QString url)
void QMLUtilities::openFolderInExplorer(QString url)
{
QProcess explorer;
#ifdef Q_OS_WIN
#ifdef Q_OS_WIN
explorer.setProgram("explorer.exe");
#elif defined(Q_OS_OSX)
#elif defined(Q_OS_OSX)
explorer.setProgram("open");
#endif
#endif
QStringList args;
args.append(QDir::toNativeSeparators(url));
explorer.setArguments(args);
explorer.startDetached();
}
void QMLUtilities::QMLUtilities::requestAllLicenses()
{
QtConcurrent::run([this]() {
QString tmp;
QFile file;
QTextStream out(&file);
file.setFileName(":/legal/Font Awesome Free License.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/gpl-3.0.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/gpl-3.0.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/OFL.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/OpenSSL.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/Qt LGPLv3.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
emit this->allLicenseLoaded(tmp);
});
}
void QMLUtilities::QMLUtilities::requestAllLDataProtection()
{
QtConcurrent::run([this]() {
QString tmp;
QFile file;
QTextStream out(&file);
file.setFileName(":/legal/DataProtection.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
emit this->allDataProtectionLoaded(tmp);
});
}
}

View File

@ -1,20 +1,14 @@
#pragma once
#include <QObject>
#include <QString>
#include <QDir>
#include <QProcess>
#include <QDebug>
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QObject>
#include <QProcess>
#include <QString>
#include <QtConcurrent/QtConcurrent>
/*!
\class Global QML Utilities
\brief Easy to use global object to use to:
\list
\i Navigate the main menu
\i Open Explorer at a given path
\endlist
*/
namespace ScreenPlay {
class QMLUtilities : public QObject {
Q_OBJECT
@ -26,6 +20,8 @@ signals:
void requestNavigationActive(bool isActive);
void requestToggleWallpaperConfiguration();
void allLicenseLoaded(QString licensesText);
void allDataProtectionLoaded(QString dataProtectionText);
public slots:
void setNavigation(QString nav);
void setNavigationActive(bool isActive);
@ -33,5 +29,9 @@ public slots:
void setToggleWallpaperConfiguration();
void openFolderInExplorer(QString url);
void requestAllLicenses();
void requestAllLDataProtection();
QString fixWindowsPath(QString url);
};
}

View File

@ -1,388 +0,0 @@
#include "screenplay.h"
ScreenPlay::ScreenPlay(InstalledListModel* ilm, Settings* set, MonitorListModel* mlm, SDKConnector* sdkc, QObject* parent)
: QObject{parent},
m_ilm{ilm},
m_settings{set},
m_mlm{mlm},
m_qGuiApplication{static_cast<QGuiApplication*>(QGuiApplication::instance())},
m_sdkc{sdkc}
{}
ScreenPlay::~ScreenPlay()
{
if(m_ilm) delete m_ilm;
if(m_settings) delete m_settings;
if(m_mlm) delete m_mlm;
if(m_qGuiApplication) delete m_qGuiApplication;
if(m_sdkc) delete m_sdkc;
}
const InstalledListModel* ScreenPlay::listModelInstalled() const noexcept { return m_ilm; }
const Settings* ScreenPlay::settings() const noexcept { return m_settings; }
const MonitorListModel* ScreenPlay::monitorListModel() const noexcept { return m_mlm; }
const QGuiApplication* ScreenPlay::guiApp() const noexcept { return m_qGuiApplication; }
const SDKConnector* ScreenPlay::sdkConnector() const noexcept { return m_sdkc; }
const std::vector<RefSPWall>& ScreenPlay::spWallList() const noexcept { return m_screenPlayWallpaperList; }
const std::vector<RefSPWidget>& ScreenPlay::spWidgetList() const noexcept { return m_screenPlayWidgetList; }
void ScreenPlay::createWallpaper(
const int monitorIndex, QUrl absoluteStoragePath,
const QString& previewImage, const float volume,
const QString& fillMode, const QString& type)
{
ProjectFile project{};
if (!m_ilm->getProjectByAbsoluteStoragePath(&absoluteStoragePath, &project)) {
return;
}
// Remove previous wallpaper, if any
//this->removeAllWallpaper();
this->removeWallpaperAt(0);
m_settings->increaseActiveWallpaperCounter();
m_screenPlayWallpaperList.emplace_back(
RefSPWall::create(
std::vector<int>{monitorIndex}, absoluteStoragePath.toLocalFile(),
previewImage, volume, fillMode, type, this)
);
m_mlm->setWallpaperActiveMonitor(m_qGuiApplication->screens().at(monitorIndex),
QString{absoluteStoragePath.toLocalFile() + "/" + previewImage});
}
void ScreenPlay::createWidget(QUrl absoluteStoragePath, const QString& previewImage)
{
ProjectFile project{};
if (!m_ilm->getProjectByAbsoluteStoragePath(&absoluteStoragePath, &project)) {
return;
}
m_screenPlayWidgetList.emplace_back(
RefSPWidget::create(
absoluteStoragePath.toLocalFile(), previewImage,
QString{absoluteStoragePath.toLocalFile() + "/" + project.m_file.toString()},
this)
);
}
void ScreenPlay::removeAllWallpaper() noexcept
{
if(m_sdkc && m_settings && !m_screenPlayWallpaperList.empty()){
m_sdkc->closeAllWallpapers();
m_settings->setActiveWallpaperCounter(0);
m_screenPlayWallpaperList.clear();
emit allWallpaperRemoved();
}
return;
}
void ScreenPlay::requestProjectSettingsListModelAt(const int index) const noexcept
{
for (const RefSPWall& refSPWallpaper: m_screenPlayWallpaperList) {
if (!refSPWallpaper.data()->screenNumber().empty() &&
refSPWallpaper.data()->screenNumber()[0] == index) { // ??? only at index == 0
emit projectSettingsListModelFound(
refSPWallpaper.data()->projectSettingsListModel().data(),
refSPWallpaper.data()->type());
return;
}
}
emit projectSettingsListModelNotFound();
}
void ScreenPlay::setWallpaperValue(const int at, const QString& key, const QString& value) noexcept
{
Q_ASSERT(static_cast<std::size_t>(at) < m_screenPlayWallpaperList.size() && m_sdkc);
for (const RefSPWall& refSPWallpaper: m_screenPlayWallpaperList) {
if (!refSPWallpaper.data()->screenNumber().empty() && m_sdkc &&
refSPWallpaper.data()->screenNumber()[0] == at) { // ??? only at index == 0
m_sdkc->setWallpaperValue(refSPWallpaper.data()->appID(), key, value);
return;
}
}
}
void ScreenPlay::setAllWallpaperValue(const QString& key, const QString& value) noexcept
{
Q_ASSERT(m_sdkc);
for (const RefSPWall& refSPWallpaper: m_screenPlayWallpaperList) {
if(m_sdkc) m_sdkc->setWallpaperValue(refSPWallpaper.data()->appID(), key, value);
}
}
void ScreenPlay::removeWallpaperAt(const int at)
{
// Q_ASSERT(at < m_screenPlayWallpaperList.size() && m_sdkc);
qDebug() << "No of walls in list: " << m_screenPlayWallpaperList.size();
if(m_screenPlayWallpaperList.empty()) return; // done here;
const auto toRemove = std::remove_if(
m_screenPlayWallpaperList.begin(), m_screenPlayWallpaperList.end(),
[&](const RefSPWall& refSPWallpaper) noexcept ->bool {
const std::vector<int>& screenNumber = refSPWallpaper->screenNumber();
qDebug() << "Screen No. :" << screenNumber.size();
const bool isFound = !screenNumber.empty();// && screenNumber[0] == at;
if(isFound) {
// m_mlm
m_sdkc->closeWallpapersAt(at); // for waht ???
m_settings->decreaseActiveWallpaperCounter();
qDebug() << "current wall count... " << m_settings->activeWallpaperCounter();
}
return isFound;
});
m_screenPlayWallpaperList.erase(toRemove, m_screenPlayWallpaperList.end());
qDebug() << "After removing: No of walls in list: " << m_screenPlayWallpaperList.size();
}
std::vector<int> ScreenPlay::getMonitorByAppID(const QString& appID) const
{
for (const RefSPWall& refSPWallpaper: m_screenPlayWallpaperList) {
if (refSPWallpaper.data()->appID() == appID) {
return refSPWallpaper.data()->screenNumber();
}
}
return std::vector<int>{};
}
QString ScreenPlay::generateID() const
{
const QString possibleCharacters{
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"};
const int randomStringLength = 32;
const auto radomGen = QRandomGenerator::system();
QString randomString;
for (int i = 0; i < randomStringLength; ++i) {
const int index = radomGen->bounded(possibleCharacters.length());
const QChar nextChar = possibleCharacters.at(index);
randomString.append(nextChar);
}
return randomString;
}
ScreenPlayWallpaper::ScreenPlayWallpaper(const std::vector<int>& screenNumber, const QString& projectPath,
const QString& previewImage, const float volume,
const QString& fillMode, const QString& type, ScreenPlay *parent)
: QObject{parent},
m_screenNumber{std::move(screenNumber)},
m_projectPath{projectPath},
m_previewImage{previewImage},
m_type{type},
m_appID{ parent ? parent->generateID() : QString{} },
m_process{nullptr},
m_projectSettingsListModel{QSharedPointer<ProjectSettingsListModel>::create(projectPath + "/project.json")}
{
QStringList proArgs;
proArgs.append(QString::number(m_screenNumber.empty() ? 0 : m_screenNumber[0]));
proArgs.append(m_projectPath);
proArgs.append("appID=" + m_appID);
proArgs.append(parent ? parent->settings()->decoder() : QString{});
proArgs.append(QString::number(static_cast<double>(volume)));
proArgs.append(fillMode);
qDebug() << proArgs;
// We do not want to parent the QProcess because the
// Process manages its lifetime and destructing (animation) itself
// via a disconnection from the ScreenPlay SDK
QProcess* m_process = new QProcess();
QObject::connect(m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
[=](int exitCode, QProcess::ExitStatus exitStatus)
{
if (exitCode != 0)
qDebug() << "WARNING EXIT CODE: " << exitCode;
});
QObject::connect(m_process, &QProcess::errorOccurred, [=](QProcess::ProcessError error) {
qDebug() << "EX: " << error;
});
m_process->setArguments(proArgs);
m_process->setProgram(parent->settings()->screenPlayWindowPath().toString());
m_process->start();
}
ScreenPlayWallpaper::~ScreenPlayWallpaper()
{
if(m_process) delete m_process;
}
const std::vector<int>& ScreenPlayWallpaper::screenNumber() const noexcept
{
return m_screenNumber;
}
const QString& ScreenPlayWallpaper::projectPath() const noexcept
{
return m_projectPath;
}
const QString& ScreenPlayWallpaper::previewImage() const noexcept
{
return m_previewImage;
}
const QString& ScreenPlayWallpaper::type() const noexcept
{
return m_type;
}
const QString& ScreenPlayWallpaper::appID() const noexcept
{
return m_appID;
}
const QSharedPointer<ProjectSettingsListModel>& ScreenPlayWallpaper::projectSettingsListModel() const noexcept
{
return m_projectSettingsListModel;
}
void ScreenPlayWallpaper::setScreenNumber(const std::vector<int>& screenNumber) noexcept
{
if (m_screenNumber == screenNumber)
return;
m_screenNumber = screenNumber;
emit screenNumberChanged(m_screenNumber);
}
void ScreenPlayWallpaper::setProjectPath(const QString& projectPath) noexcept
{
if (m_projectPath == projectPath)
return;
m_projectPath = projectPath;
emit projectPathChanged(m_projectPath);
}
void ScreenPlayWallpaper::setPreviewImage(const QString& previewImage) noexcept
{
if (m_previewImage == previewImage)
return;
m_previewImage = previewImage;
emit previewImageChanged(m_previewImage);
}
void ScreenPlayWallpaper::setType(const QString& type) noexcept
{
if (m_type == type)
return;
m_type = type;
emit typeChanged(m_type);
}
void ScreenPlayWallpaper::setAppID(const QString& appID) noexcept
{
if (m_appID == appID)
return;
m_appID = appID;
emit appIDChanged(m_appID);
}
ScreenPlayWidget::ScreenPlayWidget(const QString& projectPath, const QString& previewImage,
const QString& fullPath, ScreenPlay *parent)
: m_projectPath{projectPath},
m_previewImage{previewImage},
m_fullPath{fullPath},
m_appID{parent ? parent->generateID() : QString{}},
m_position{0, 0},
m_process{nullptr}
{
QStringList proArgs;
proArgs.append(m_projectPath);
proArgs.append(m_appID);
m_process = new QProcess(this); //PLS LESS BEHINDERT @Elias
m_process->setArguments(proArgs);
if (fullPath.endsWith(".exe")) {
m_process->setProgram(fullPath);
} else if (fullPath.endsWith(".qml")) {
m_process->setProgram(parent->settings()->getScreenPlayWidgetPath().path());
}
qDebug() << m_process->program();
QObject::connect(m_process, &QProcess::errorOccurred, this, [](QProcess::ProcessError error) {
qDebug() << "error: " << error;
});
m_process->start();
}
ScreenPlayWidget::~ScreenPlayWidget()
{
if(m_process) delete m_process;
}
const QString& ScreenPlayWidget::projectPath() const noexcept
{
return m_projectPath;
}
const QString& ScreenPlayWidget::previewImage() const noexcept
{
return m_previewImage;
}
const QString& ScreenPlayWidget::fullPath() const noexcept
{
return m_fullPath;
}
const QString& ScreenPlayWidget::appID() const noexcept
{
return m_appID;
}
const QPoint& ScreenPlayWidget::position() const noexcept
{
return m_position;
}
void ScreenPlayWidget::setProjectPath(const QString& projectPath) noexcept
{
if (m_projectPath == projectPath)
return;
m_projectPath = projectPath;
emit projectPathChanged(m_projectPath);
}
void ScreenPlayWidget::setPreviewImage(const QString& previewImage) noexcept
{
if (m_previewImage == previewImage)
return;
m_previewImage = previewImage;
emit previewImageChanged(m_previewImage);
}
void ScreenPlayWidget::setFullPath(const QString& fullPath) noexcept
{
if (m_fullPath == fullPath)
return;
m_fullPath = fullPath;
emit fullPathChanged(m_fullPath);
}
void ScreenPlayWidget::setAppID(const QString& appID) noexcept
{
if (m_appID == appID)
return;
m_appID = appID;
emit appIDChanged(m_appID);
}
void ScreenPlayWidget::setPosition(const QPoint& position) noexcept
{
if (m_position == position)
return;
m_position = position;
emit positionChanged(m_position);
}

View File

@ -1,195 +0,0 @@
#pragma once
#include <QCryptographicHash>
#include <QGuiApplication>
#include <QObject>
#include <QPoint>
#include <QProcess>
#include <QRandomGenerator>
#include <QSharedPointer>
#include "installedlistmodel.h"
#include "monitorlistmodel.h"
#include "projectfile.h"
#include "projectsettingslistmodel.h"
#include "sdkconnector.h"
#include "settings.h"
/*!
\class ScreenPlay
\brief Used for Creation of Wallpaper, Scenes and Widgets
*/
class ScreenPlayWallpaper;
class ScreenPlayWidget;
// convenience types
using RefSPWall = QSharedPointer<ScreenPlayWallpaper>;
using RefSPWidget = QSharedPointer<ScreenPlayWidget>;
class ScreenPlay final: public QObject {
Q_OBJECT
private:
InstalledListModel *const m_ilm{nullptr};
Settings *const m_settings{nullptr};
MonitorListModel *const m_mlm{nullptr};
QGuiApplication *const m_qGuiApplication{nullptr};
SDKConnector *const m_sdkc{nullptr};
std::vector<RefSPWall> m_screenPlayWallpaperList;
std::vector<RefSPWidget> m_screenPlayWidgetList;
public:
// constructor(s)
explicit ScreenPlay(
InstalledListModel* ilm, Settings* set,
MonitorListModel* mlm, SDKConnector* sdkc,
QObject* parent = nullptr);
// copy and move disable(for now) : remember rule of 1/3/5
Q_DISABLE_COPY_MOVE(ScreenPlay)
// destructor
~ScreenPlay();
// getters
const InstalledListModel* listModelInstalled() const noexcept;
const Settings* settings() const noexcept;
const MonitorListModel* monitorListModel() const noexcept;
const QGuiApplication* guiApp() const noexcept;
const SDKConnector* sdkConnector() const noexcept;
const std::vector<RefSPWall>& spWallList() const noexcept;
const std::vector<RefSPWidget>& spWidgetList() const noexcept;
signals:
void allWallpaperRemoved() const;
void projectSettingsListModelFound(ProjectSettingsListModel* li, const QString& type) const;
void projectSettingsListModelNotFound() const;
public slots:
void createWallpaper(
const int monitorIndex, QUrl absoluteStoragePath,
const QString& previewImage, const float volume,
const QString& fillMode, const QString& type);
void createWidget(QUrl absoluteStoragePath, const QString& previewImage);
void removeAllWallpaper() noexcept;
void requestProjectSettingsListModelAt(const int index) const noexcept;
void setWallpaperValue(const int at, const QString& key, const QString& value) noexcept;
void setAllWallpaperValue(const QString& key, const QString& value) noexcept;
void removeWallpaperAt(const int at = 0);
std::vector<int> getMonitorByAppID(const QString& appID) const;
QString generateID() const;
};
/*!
\class ScreenPlayWallpaper
\brief Used for ...
*/
class ScreenPlayWallpaper final: public QObject {
Q_OBJECT
Q_PROPERTY(std::vector<int> screenNumber READ screenNumber WRITE setScreenNumber NOTIFY screenNumberChanged)
Q_PROPERTY(QString projectPath READ projectPath WRITE setProjectPath NOTIFY projectPathChanged)
Q_PROPERTY(QString previewImage READ previewImage WRITE setPreviewImage NOTIFY previewImageChanged)
Q_PROPERTY(QString appID READ appID WRITE setAppID NOTIFY appIDChanged)
Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged)
private:
std::vector<int> m_screenNumber;
QString m_projectPath;
QString m_previewImage;
QString m_type;
QString m_appID;
QProcess *m_process;
QSharedPointer<ProjectSettingsListModel> m_projectSettingsListModel;
public:
// constructor(s)
explicit ScreenPlayWallpaper(const std::vector<int>& screenNumber, const QString& projectPath,
const QString& previewImage, const float volume, const QString& fillMode,
const QString& type, ScreenPlay *parent = nullptr);
// copy and move disable(for now) : remember rule of 1/3/5
Q_DISABLE_COPY_MOVE(ScreenPlayWallpaper)
// destructor
~ScreenPlayWallpaper();
// getters
const std::vector<int>& screenNumber() const noexcept;
const QString& projectPath() const noexcept;
const QString& previewImage() const noexcept;
const QString& type() const noexcept;
const QString& appID() const noexcept;
const QSharedPointer<ProjectSettingsListModel>& projectSettingsListModel() const noexcept;
signals:
void screenNumberChanged(std::vector<int> screenNumber) const;
void projectPathChanged(QString projectPath) const;
void previewImageChanged(QString previewImage) const;
void typeChanged(QString type) const;
void appIDChanged(QString appID) const;
//void projectSettingsListModelAt(ProjectSettingsListModel* li); ??? not used
public slots:
void setScreenNumber(const std::vector<int>& screenNumber) noexcept;
void setProjectPath(const QString& projectPath) noexcept;
void setPreviewImage(const QString& previewImage) noexcept;
void setType(const QString& type) noexcept;
void setAppID(const QString& appID) noexcept;
};
/*!
\class ScreenPlayWidget
\brief Used for ...
*/
class ScreenPlayWidget final: public QObject {
Q_OBJECT
Q_PROPERTY(QString projectPath READ projectPath WRITE setProjectPath NOTIFY projectPathChanged)
Q_PROPERTY(QString fullPath READ fullPath WRITE setFullPath NOTIFY fullPathChanged)
Q_PROPERTY(QString previewImage READ previewImage WRITE setPreviewImage NOTIFY previewImageChanged)
Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged)
Q_PROPERTY(QString appID READ appID WRITE setAppID NOTIFY appIDChanged)
private:
QString m_projectPath;
QString m_previewImage;
QString m_fullPath;
QString m_appID;
QPoint m_position;
QProcess *m_process;
public:
// constructor(s)
explicit ScreenPlayWidget(const QString& projectPath, const QString& previewImage,
const QString& fullPath, ScreenPlay *parent = nullptr);
// copy and move disable(for now) : remember rule of 1/3/5
Q_DISABLE_COPY_MOVE(ScreenPlayWidget)
// destructor
~ScreenPlayWidget();
// getters
const QString& projectPath() const noexcept;
const QString& previewImage() const noexcept;
const QString& fullPath() const noexcept;
const QString& appID() const noexcept;
const QPoint& position() const noexcept;
signals:
void projectPathChanged(QString projectPath) const;
void previewImageChanged(QString previewImage) const;
void fullPathChanged(QString fullPath) const;
void appIDChanged(QString appID) const;
void positionChanged(QPoint position) const;
public slots:
void setProjectPath(const QString& projectPath) noexcept;
void setPreviewImage(const QString& previewImage) noexcept;
void setFullPath(const QString& fullPath) noexcept;
void setAppID(const QString& appID) noexcept;
void setPosition(const QPoint& position) noexcept;
};

View File

@ -0,0 +1,145 @@
#include "screenplaymanager.h"
namespace ScreenPlay {
ScreenPlayManager::ScreenPlayManager(const shared_ptr<InstalledListModel>& ilm,
const shared_ptr<Settings>& settings,
const shared_ptr<MonitorListModel>& mlm,
const shared_ptr<SDKConnector>& sdkc,
QObject* parent)
: QObject { parent }
, m_installedListModel { ilm }
, m_settings { settings }
, m_monitorListModel { mlm }
, m_sdkconnector { sdkc }
, m_qGuiApplication { static_cast<QGuiApplication*>(QGuiApplication::instance()) }
{
}
void ScreenPlayManager::createWallpaper(
const int monitorIndex, QUrl absoluteStoragePath,
const QString& previewImage, const float volume,
const QString& fillMode, const QString& type)
{
ProjectFile project {};
if (!m_installedListModel->getProjectByAbsoluteStoragePath(&absoluteStoragePath, &project)) {
return;
}
m_settings->increaseActiveWallpaperCounter();
m_screenPlayWallpapers.emplace_back(
make_unique<ScreenPlayWallpaper>(
vector<int> { monitorIndex },
m_settings,
generateID(),
absoluteStoragePath.toLocalFile(),
previewImage,
volume,
fillMode,
type,
this));
m_monitorListModel->setWallpaperActiveMonitor(m_qGuiApplication->screens().at(monitorIndex),
QString { absoluteStoragePath.toLocalFile() + "/" + previewImage });
m_settings->saveWallpaperToConfig(monitorIndex, absoluteStoragePath, type);
}
void ScreenPlayManager::createWidget(QUrl absoluteStoragePath, const QString& previewImage)
{
ProjectFile project {};
if (!m_installedListModel->getProjectByAbsoluteStoragePath(&absoluteStoragePath, &project)) {
return;
}
m_screenPlayWidgets.emplace_back(
make_unique<ScreenPlayWidget>(
generateID(),
m_settings,
absoluteStoragePath.toLocalFile(),
previewImage,
QString { absoluteStoragePath.toLocalFile() + "/" + project.m_file.toString() },
this));
}
void ScreenPlayManager::removeAllWallpaper()
{
if (m_settings && !m_screenPlayWallpapers.empty()) {
m_sdkconnector->closeAllWallpapers();
m_settings->setActiveWallpaperCounter(0);
m_screenPlayWallpapers.clear();
emit allWallpaperRemoved();
}
return;
}
void ScreenPlayManager::requestProjectSettingsListModelAt(const int index)
{
for (const unique_ptr<ScreenPlayWallpaper>& uPtrWallpaper : m_screenPlayWallpapers) {
if (!uPtrWallpaper->screenNumber().empty() && uPtrWallpaper->screenNumber()[0] == index) { // ??? only at index == 0
emit projectSettingsListModelFound(
uPtrWallpaper->projectSettingsListModel().data(),
uPtrWallpaper->type());
return;
}
}
emit projectSettingsListModelNotFound();
}
void ScreenPlayManager::setWallpaperValue(const int at, const QString& key, const QString& value)
{
Q_ASSERT(static_cast<size_t>(at) < m_screenPlayWallpapers.size() && m_sdkconnector);
for (const unique_ptr<ScreenPlayWallpaper>& uPtrWallpaper : m_screenPlayWallpapers) {
if (!uPtrWallpaper->screenNumber().empty() && m_sdkconnector && uPtrWallpaper->screenNumber()[0] == at) { // ??? only at index == 0
m_sdkconnector->setWallpaperValue(uPtrWallpaper->appID(), key, value);
return;
}
}
}
void ScreenPlayManager::setAllWallpaperValue(const QString& key, const QString& value)
{
for (const unique_ptr<ScreenPlayWallpaper>& uPtrWallpaper : m_screenPlayWallpapers) {
m_sdkconnector->setWallpaperValue(uPtrWallpaper->appID(), key, value);
}
}
void ScreenPlayManager::removeWallpaperAt(const int at)
{
if (m_screenPlayWallpapers.empty())
return;
const auto wallsToRemove = remove_if(
m_screenPlayWallpapers.begin(), m_screenPlayWallpapers.end(),
[&](const unique_ptr<ScreenPlayWallpaper>& uPtrWallpaper) -> bool {
const vector<int>& screenNumber = uPtrWallpaper->screenNumber();
const bool isFound = !screenNumber.empty() && screenNumber[0] == at;
if (isFound) {
m_sdkconnector->closeWallpapersAt(at);
m_settings->decreaseActiveWallpaperCounter();
}
return isFound;
});
m_screenPlayWallpapers.erase(wallsToRemove, m_screenPlayWallpapers.end());
}
QString ScreenPlayManager::generateID() const
{
const QString possibleCharacters {
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
};
const int randomStringLength = 32;
const auto radomGen = QRandomGenerator::system();
QString randomString;
for (int i = 0; i < randomStringLength; ++i) {
const int index = radomGen->bounded(possibleCharacters.length());
const QChar nextChar = possibleCharacters.at(index);
randomString.append(nextChar);
}
return randomString;
}
}

View File

@ -0,0 +1,78 @@
#pragma once
#include <QCryptographicHash>
#include <QGuiApplication>
#include <QObject>
#include <QPoint>
#include <QProcess>
#include <QRandomGenerator>
#include <QSharedPointer>
#include "installedlistmodel.h"
#include "monitorlistmodel.h"
#include "projectfile.h"
#include "projectsettingslistmodel.h"
#include "screenplaywallpaper.h"
#include "screenplaywidget.h"
#include "sdkconnector.h"
#include "settings.h"
/*!
\class ScreenPlay
\brief Used for Creation of Wallpaper, Scenes and Widgets
*/
namespace ScreenPlay {
using std::shared_ptr,
std::unique_ptr,
std::make_shared,
std::make_unique,
std::vector,
std::size_t,
std::remove_if;
class ScreenPlayManager final : public QObject {
Q_OBJECT
public:
explicit ScreenPlayManager(
const shared_ptr<InstalledListModel>& ilm,
const shared_ptr<Settings>& settings,
const shared_ptr<MonitorListModel>& mlm,
const shared_ptr<SDKConnector>& sdkc,
QObject* parent = nullptr);
~ScreenPlayManager() {}
signals:
void allWallpaperRemoved();
void projectSettingsListModelFound(ProjectSettingsListModel* li, const QString& type);
void projectSettingsListModelNotFound();
public slots:
void createWallpaper(
const int monitorIndex, QUrl absoluteStoragePath,
const QString& previewImage, const float volume,
const QString& fillMode, const QString& type);
void createWidget(QUrl absoluteStoragePath, const QString& previewImage);
void removeAllWallpaper();
void requestProjectSettingsListModelAt(const int index);
void setWallpaperValue(const int at, const QString& key, const QString& value);
void setAllWallpaperValue(const QString& key, const QString& value);
void removeWallpaperAt(const int at = 0);
QString generateID() const;
private:
const shared_ptr<InstalledListModel> m_installedListModel;
const shared_ptr<Settings> m_settings;
const shared_ptr<MonitorListModel> m_monitorListModel;
const shared_ptr<SDKConnector> m_sdkconnector;
const QGuiApplication* const m_qGuiApplication;
vector<unique_ptr<ScreenPlayWallpaper>> m_screenPlayWallpapers;
vector<unique_ptr<ScreenPlayWidget>> m_screenPlayWidgets;
};
}

View File

@ -0,0 +1,54 @@
#include "screenplaywallpaper.h"
/*!
\class ScreenPlayWallpaper
\brief Used for ...
*/
namespace ScreenPlay {
ScreenPlayWallpaper::ScreenPlayWallpaper(const vector<int>& screenNumber,
const shared_ptr<Settings>& settings,
const QString& appID,
const QString& projectPath,
const QString& previewImage,
const float volume,
const QString& fillMode,
const QString& type,
QObject* parent)
: QObject(parent)
, m_projectSettingsListModel { QSharedPointer<ProjectSettingsListModel>::create(projectPath + "/project.json") }
, m_screenNumber { move(screenNumber) }
, m_projectPath { projectPath }
, m_previewImage { previewImage }
, m_appID { appID }
, m_type { type }
, m_settings { settings }
{
QObject::connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
[=](int exitCode, QProcess::ExitStatus exitStatus) {
Q_UNUSED(exitStatus)
if (exitCode != 0)
qDebug() << "WARNING EXIT CODE: " << exitCode;
});
QObject::connect(&m_process, &QProcess::errorOccurred, [=](QProcess::ProcessError error) {
qDebug() << "EX: " << error;
});
const QStringList proArgs {
QString::number(m_screenNumber.empty() ? 0 : m_screenNumber[0]),
m_projectPath,
QString { "appID=" + m_appID },
"",
QString::number(static_cast<double>(volume)),
fillMode
};
//qDebug() << "Creating ScreenPlayWallpaper " << proArgs;
m_process.setArguments(proArgs);
m_process.setProgram(m_settings->screenPlayWindowPath().toString());
m_process.startDetached();
}
}

View File

@ -0,0 +1,131 @@
#pragma once
#include <QObject>
#include <QProcess>
#include <memory>
#include "projectsettingslistmodel.h"
#include "settings.h"
namespace ScreenPlay {
using std::shared_ptr,
std::make_shared,
std::vector,
std::move;
class ScreenPlayWallpaper final : public QObject {
Q_OBJECT
Q_PROPERTY(vector<int> screenNumber READ screenNumber WRITE setScreenNumber NOTIFY screenNumberChanged)
Q_PROPERTY(QString projectPath READ projectPath WRITE setProjectPath NOTIFY projectPathChanged)
Q_PROPERTY(QString previewImage READ previewImage WRITE setPreviewImage NOTIFY previewImageChanged)
Q_PROPERTY(QString appID READ appID WRITE setAppID NOTIFY appIDChanged)
Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged)
public:
explicit ScreenPlayWallpaper(const vector<int>& screenNumber,
const shared_ptr<Settings>& settings,
const QString& appID,
const QString& projectPath,
const QString& previewImage,
const float volume,
const QString& fillMode,
const QString& type,
QObject* parent = nullptr);
~ScreenPlayWallpaper() {}
const QSharedPointer<ProjectSettingsListModel>& projectSettingsListModel() const noexcept
{
return m_projectSettingsListModel;
}
vector<int> screenNumber() const
{
return m_screenNumber;
}
QString projectPath() const
{
return m_projectPath;
}
QString previewImage() const
{
return m_previewImage;
}
QString appID() const
{
return m_appID;
}
QString type() const
{
return m_type;
}
signals:
void screenNumberChanged(vector<int> screenNumber);
void projectPathChanged(QString projectPath);
void previewImageChanged(QString previewImage);
void appIDChanged(QString appID);
void typeChanged(QString type);
public slots:
void setScreenNumber(vector<int> screenNumber)
{
if (m_screenNumber == screenNumber)
return;
m_screenNumber = screenNumber;
emit screenNumberChanged(m_screenNumber);
}
void setProjectPath(QString projectPath)
{
if (m_projectPath == projectPath)
return;
m_projectPath = projectPath;
emit projectPathChanged(m_projectPath);
}
void setPreviewImage(QString previewImage)
{
if (m_previewImage == previewImage)
return;
m_previewImage = previewImage;
emit previewImageChanged(m_previewImage);
}
void setAppID(QString appID)
{
if (m_appID == appID)
return;
m_appID = appID;
emit appIDChanged(m_appID);
}
void setType(QString type)
{
if (m_type == type)
return;
m_type = type;
emit typeChanged(m_type);
}
private:
QProcess m_process;
QSharedPointer<ProjectSettingsListModel> m_projectSettingsListModel;
vector<int> m_screenNumber;
QString m_projectPath;
QString m_previewImage;
QString m_appID;
QString m_type;
const shared_ptr<Settings> m_settings;
};
}

View File

@ -0,0 +1,37 @@
#include "screenplaywidget.h"
/*!
\class ScreenPlayWidget
\brief Used for ...
*/
namespace ScreenPlay {
ScreenPlayWidget::ScreenPlayWidget(const QString& appID, const shared_ptr<Settings>& settings,
const QString& projectPath,
const QString& previewImage,
const QString& fullPath,
QObject* parent)
: QObject { parent }
, m_projectPath { projectPath }
, m_previewImage { previewImage }
, m_appID { appID }
, m_position { 0, 0 }
, m_settings(settings)
{
const QStringList proArgs { m_projectPath, m_appID };
m_process.setArguments(proArgs);
if (fullPath.endsWith(".exe")) {
m_process.setProgram(fullPath);
} else if (fullPath.endsWith(".qml")) {
m_process.setProgram(m_settings->getScreenPlayWidgetPath().path());
}
qDebug() << m_process.program();
QObject::connect(&m_process, &QProcess::errorOccurred, this, [](QProcess::ProcessError error) {
qDebug() << "error: " << error;
});
m_process.startDetached();
}
}

View File

@ -0,0 +1,100 @@
#pragma once
#include <QDebug>
#include <QObject>
#include <QPoint>
#include <QProcess>
#include <memory>
#include "settings.h"
namespace ScreenPlay {
using std::shared_ptr,
std::make_shared;
class ScreenPlayWidget final : public QObject {
Q_OBJECT
Q_PROPERTY(QString projectPath READ projectPath WRITE setProjectPath NOTIFY projectPathChanged)
Q_PROPERTY(QString previewImage READ previewImage WRITE setPreviewImage NOTIFY previewImageChanged)
Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged)
Q_PROPERTY(QString appID READ appID WRITE setAppID NOTIFY appIDChanged)
public:
explicit ScreenPlayWidget(const QString& appID, const shared_ptr<Settings>& settings, const QString& projectPath, const QString& previewImage,
const QString& fullPath, QObject* parent = nullptr);
~ScreenPlayWidget() {}
QString projectPath() const
{
return m_projectPath;
}
QString previewImage() const
{
return m_previewImage;
}
QPoint position() const
{
return m_position;
}
QString appID() const
{
return m_appID;
}
public slots:
void setProjectPath(QString projectPath)
{
if (m_projectPath == projectPath)
return;
m_projectPath = projectPath;
emit projectPathChanged(m_projectPath);
}
void setPreviewImage(QString previewImage)
{
if (m_previewImage == previewImage)
return;
m_previewImage = previewImage;
emit previewImageChanged(m_previewImage);
}
void setPosition(QPoint position)
{
if (m_position == position)
return;
m_position = position;
emit positionChanged(m_position);
}
void setAppID(QString appID)
{
if (m_appID == appID)
return;
m_appID = appID;
emit appIDChanged(m_appID);
}
signals:
void projectPathChanged(QString projectPath);
void previewImageChanged(QString previewImage);
void positionChanged(QPoint position);
void appIDChanged(QString appID);
private:
QString m_projectPath;
QString m_previewImage;
QString m_appID;
QPoint m_position;
QProcess m_process;
const shared_ptr<Settings> m_settings;
};
}

View File

@ -2,7 +2,7 @@
#include <QJsonDocument>
#include <QJsonObject>
namespace ScreenPlay {
SDKConnector::SDKConnector(QObject* parent)
: QObject(parent)
{
@ -84,3 +84,4 @@ QLocalSocket* SDKConnection::socket() const
{
return m_socket;
}
}

View File

@ -13,6 +13,8 @@
\brief Used for every Wallpaper, Scene or Widget communication via Windows pipes/QLocalSocket
*/
namespace ScreenPlay {
class SDKConnection;
class SDKConnector : public QObject {
@ -20,8 +22,6 @@ class SDKConnector : public QObject {
public:
explicit SDKConnector(QObject* parent = nullptr);
signals:
public slots:
void readyRead();
void newConnection();
@ -41,14 +41,16 @@ class SDKConnection : public QObject {
Q_PROPERTY(QVector<int> monitor READ monitor WRITE setMonitor NOTIFY monitorChanged)
public:
explicit SDKConnection(QLocalSocket* socket, QObject* parent = nullptr) : QObject(parent)
explicit SDKConnection(QLocalSocket* socket, QObject* parent = nullptr)
: QObject(parent)
{
m_socket = socket;
connect(m_socket, &QLocalSocket::readyRead, this, &SDKConnection::readyRead);
connect(m_socket, &QLocalSocket::disconnected, this, &SDKConnection::close);
}
~SDKConnection (){
~SDKConnection()
{
// We need to call this manually because
// sometimes it wont close the connection in
@ -85,7 +87,8 @@ public slots:
//Only use the first 32 chars for the appID
m_appID = msg.remove("appID=").mid(0, 32);
msg.remove(m_appID);
qDebug() << "###### Wallpaper width APPID created:" << "\n######" << m_appID;
qDebug() << "###### Wallpaper width APPID created:"
<< "\n######" << m_appID;
} else {
qDebug() << "### Message from: " << m_appID << "\n###" << msg;
}
@ -127,3 +130,4 @@ private:
QString m_appID;
QVector<int> m_monitor;
};
}

View File

@ -1,17 +1,37 @@
#include "settings.h"
#include <QGuiApplication>
#include <QStandardPaths>
Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListModel* ilm, SDKConnector* sdkc, QObject* parent)
/*!
\class Settings
\brief Used for:
\list
\i User configuration
\i Communication via the SDK Connector
\endlist
*/
namespace ScreenPlay {
Settings::Settings(const shared_ptr<InstalledListModel>& ilm,
const shared_ptr<ProfileListModel>& plm,
const shared_ptr<MonitorListModel>& mlm,
const shared_ptr<SDKConnector>& sdkc,
QObject* parent)
: QObject(parent)
, m_version(QVersionNumber(0, 0, 1))
, m_profileListModel(plm)
, m_installedListModel(ilm)
, m_monitorListModel(mlm)
, m_sdkconnector(sdkc)
{
auto* app = static_cast<QGuiApplication*>(QGuiApplication::instance());
m_plm = plm;
m_mlm = mlm;
m_ilm = ilm;
m_sdkc = sdkc;
m_app = static_cast<QGuiApplication*>(QGuiApplication::instance());
QFontDatabase::addApplicationFont(":/assets/fonts/LibreBaskerville-Italic.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Light.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Regular.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/Roboto-Thin.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Light.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/RobotoMono-Thin.ttf");
if (m_qSettings.value("language").isNull()) {
auto locale = QLocale::system().uiLanguages();
@ -24,13 +44,13 @@ Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListMo
m_translator.load(":/translations/ScreenPlay_" + localeSplits.at(0) + ".qm");
m_qSettings.setValue("language", QVariant(localeSplits.at(0)));
m_qSettings.sync();
m_app->installTranslator(&m_translator);
app->installTranslator(&m_translator);
}
} else {
QFile tsFile;
if (tsFile.exists(":/translations/ScreenPlay_" + m_qSettings.value("language").toString() + ".qm")) {
m_translator.load(":/translations/ScreenPlay_" + m_qSettings.value("language").toString() + ".qm");
m_app->installTranslator(&m_translator);
app->installTranslator(&m_translator);
}
}
@ -73,10 +93,10 @@ Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListMo
configObj = configJsonDocument.object();
QString tmp(configObj.value("version").toVariant().toString());
int major, minor, patch;
major = QString(tmp.at(0)).toInt();
minor = QString(tmp.at(2)).toInt();
patch = QString(tmp.at(4)).toInt();
int major = QString(tmp.at(0)).toInt();
int minor = QString(tmp.at(2)).toInt();
int patch = QString(tmp.at(4)).toInt();
QVersionNumber fileVersion(major, minor, patch);
//Checks if the settings file has the same version as ScreeenPlay
@ -101,34 +121,21 @@ Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListMo
m_localStoragePath = QUrl::fromUserInput(configObj.value("absoluteStoragePath").toString());
}
m_ilm->setabsoluteStoragePath(m_localStoragePath);
m_plm->m_localStoragePath = m_localStoragePath;
if (m_qSettings.value("ScreenPlayInstalledPath").isNull()) {
m_qSettings.setValue("ScreenPlayInstalledPath", QDir::toNativeSeparators(m_localStoragePath.toString().remove("file:///")));
m_qSettings.sync();
}
m_installedListModel->setabsoluteStoragePath(m_localStoragePath);
m_profileListModel->m_localStoragePath = m_localStoragePath;
m_autostart = configObj.value("autostart").toBool();
m_highPriorityStart = configObj.value("highPriorityStart").toBool();
m_sendStatistics = configObj.value("sendStatistics").toBool();
int renderer = static_cast<int>(configObj.value("renderer-value").toInt());
m_checkForOtherFullscreenApplicationTimer = new QTimer(this);
connect(m_checkForOtherFullscreenApplicationTimer, &QTimer::timeout, this, &Settings::checkForOtherFullscreenApplication);
m_checkForOtherFullscreenApplicationTimer->start(1500);
setupWidgetAndWindowPaths();
}
Settings::~Settings()
{
}
QString Settings::loadProject(QString file)
{
QFile configTmp;
//file = file.replace("file:///", "");
configTmp.setFileName(file);
configTmp.open(QIODevice::ReadOnly | QIODevice::Text);
return configTmp.readAll();
}
void Settings::loadActiveProfiles()
{
QJsonDocument configJsonDocument;
@ -164,20 +171,6 @@ void Settings::loadActiveProfiles()
}
}
void Settings::setGlobalVolume(float volume)
{
// for (int i = 0; i < m_wallpapers.size(); ++i) {
// m_wallpapers.at(i).data()->setVolume(volume);
// }
}
void Settings::setGlobalFillMode(QString fillMode)
{
// for (int i = 0; i < m_wallpapers.size(); ++i) {
// m_wallpapers.at(i).data()->setFillMode(fillMode);
// }
}
void Settings::writeSingleSettingConfig(QString name, QVariant value)
{
@ -207,65 +200,11 @@ void Settings::writeSingleSettingConfig(QString name, QVariant value)
configTmp.close();
}
void Settings::requestAllLicenses()
void Settings::saveWallpaperToConfig(const int monitorIndex, const QUrl& absoluteStoragePath, const QString& type)
{
QtConcurrent::run([this]() {
QString tmp;
QFile file;
QTextStream out(&file);
file.setFileName(":/legal/Font Awesome Free License.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/gpl-3.0.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/gpl-3.0.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/OFL.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/OpenSSL.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/Qt LGPLv3.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
emit this->allLicenseLoaded(tmp);
});
}
void Settings::requestAllLDataProtection()
{
QtConcurrent::run([this]() {
QString tmp;
QFile file;
QTextStream out(&file);
file.setFileName(":/legal/DataProtection.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
emit this->allDataProtectionLoaded(tmp);
});
}
void Settings::saveWallpaper(int monitorIndex, QUrl absoluteStoragePath, QStringList properties, QString type)
void Settings::removeWallpaperFromConfig(const int monitorIndex)
{
}
@ -275,33 +214,6 @@ void Settings::setqSetting(const QString& key, const QString& value)
m_qSettings.sync();
}
void Settings::setMuteAll(bool isMuted)
{
// if (isMuted) {
// for (int i = 0; i < m_wallpapers.size(); ++i) {
// m_wallpapers.at(i).data()->setVolume(0.0f);
// }
// } else {
// for (int i = 0; i < m_wallpapers.size(); ++i) {
// m_wallpapers.at(i).data()->setVolume(1.0f);
// }
// }
}
void Settings::setPlayAll(bool isPlaying)
{
// if (isPlaying) {
// for (int i = 0; i < m_wallpapers.size(); ++i) {
// m_wallpapers.at(i).data()->setIsPlaying(true);
// }
// } else {
// for (int i = 0; i < m_wallpapers.size(); ++i) {
// m_wallpapers.at(i).data()->setIsPlaying(false);
// }
// }
}
void Settings::createDefaultConfig()
{
@ -326,7 +238,6 @@ void Settings::setupWidgetAndWindowPaths()
QDir SPBaseDir(QDir::currentPath());
#ifdef QT_DEBUG
qDebug() << "Starting in Debug mode!";
if (SPWorkingDir.cdUp()) {
#ifdef Q_OS_OSX
@ -376,55 +287,4 @@ void Settings::setupWidgetAndWindowPaths()
}
#endif
}
bool Settings::getOfflineMode() const
{
return m_offlineMode;
}
QUrl Settings::getScreenPlayWidgetPath() const
{
return m_screenPlayWidgetPath;
}
void Settings::setScreenPlayWidgetPath(const QUrl& screenPlayWidgetPath)
{
m_screenPlayWidgetPath = screenPlayWidgetPath;
}
QUrl Settings::getScreenPlayBasePath() const
{
return m_screenPlayBasePath;
}
void Settings::setScreenPlayBasePath(QUrl screenPlayBasePath)
{
m_screenPlayBasePath = screenPlayBasePath;
}
QUrl Settings::getScreenPlayWindowPath() const
{
return m_screenPlayWindowPath;
}
void Settings::setScreenPlayWindowPath(const QUrl& screenPlayWindowPath)
{
m_screenPlayWindowPath = screenPlayWindowPath;
}
void Settings::checkForOtherFullscreenApplication()
{
#ifdef Q_OS_WIN
HWND hWnd = GetForegroundWindow();
RECT appBounds;
RECT rc;
GetWindowRect(GetDesktopWindow(), &rc);
#endif
// if(hWnd =! (HWND)GetDesktopWindow() && hWnd != (HWND)GetShellWindow())
// {
// GetWindowRect(hWnd, &appBounds);
// } else {
// }
}

View File

@ -3,6 +3,7 @@
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFontDatabase>
#include <QGuiApplication>
#include <QJsonArray>
#include <QJsonDocument>
@ -25,6 +26,8 @@
#include <QtConcurrent/QtConcurrent>
#include <QtGlobal>
#include <memory>
#include "installedlistmodel.h"
#include "monitorlistmodel.h"
#include "profile.h"
@ -35,23 +38,16 @@
#ifdef Q_OS_WIN
#include <qt_windows.h>
#endif
/*!
\class Settings
\brief Used for:
\list
\i User configuration
\i Communication via the SDK Connector
\endlist
*/
namespace ScreenPlay {
class ActiveProfile;
using std::shared_ptr,
std::make_shared;
class Settings : public QObject {
Q_OBJECT
Q_PROPERTY(QVersionNumber version READ version)
Q_PROPERTY(bool hasWorkshopBannerSeen READ hasWorkshopBannerSeen WRITE setHasWorkshopBannerSeen NOTIFY hasWorkshopBannerSeenChanged)
Q_PROPERTY(QVersionNumber version READ version )
Q_PROPERTY(bool autostart READ autostart WRITE setAutostart NOTIFY autostartChanged)
Q_PROPERTY(bool highPriorityStart READ highPriorityStart WRITE setHighPriorityStart NOTIFY highPriorityStartChanged)
Q_PROPERTY(bool sendStatistics READ sendStatistics WRITE setSendStatistics NOTIFY sendStatisticsChanged)
@ -62,16 +58,13 @@ class Settings : public QObject {
Q_PROPERTY(int activeWallpaperCounter READ activeWallpaperCounter WRITE setActiveWallpaperCounter NOTIFY activeWallpaperCounterChanged)
public:
explicit Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListModel* ilm, SDKConnector* sdkc, QObject* parent = nullptr);
~Settings();
enum LocalCopyResult {
NoError,
CopyError,
NotEnoughDiskSpace,
NameCollision,
};
Q_ENUM(LocalCopyResult)
explicit Settings(
const shared_ptr<InstalledListModel>& ilm,
const shared_ptr<ProfileListModel>& plm,
const shared_ptr<MonitorListModel>& mlm,
const shared_ptr<SDKConnector>& sdkc,
QObject* parent = nullptr);
~Settings() {}
QVersionNumber version() const
{
@ -88,19 +81,11 @@ public:
return m_localStoragePath;
}
bool hasWorkshopBannerSeen() const
{
return m_hasWorkshopBannerSeen;
}
int activeWallpaperCounter() const
{
return m_activeWallpaperCounter;
}
QUrl getScreenPlayWindowPath() const;
void setScreenPlayWindowPath(const QUrl& screenPlayWindowPath);
bool pauseWallpaperWhenIngame() const
{
return m_pauseWallpaperWhenIngame;
@ -111,39 +96,41 @@ public:
return m_offlineMode;
}
QUrl getScreenPlayBasePath() const;
void setScreenPlayBasePath(QUrl screenPlayBasePath);
QUrl getScreenPlayWindowPath() const
{
return m_screenPlayWindowPath;
}
QUrl getScreenPlayWidgetPath() const;
void setScreenPlayWidgetPath(const QUrl& screenPlayWidgetPath);
void setScreenPlayWindowPath(const QUrl& screenPlayWindowPath)
{
m_screenPlayWindowPath = screenPlayWindowPath;
}
bool getOfflineMode() const;
QUrl getScreenPlayBasePath() const
{
return m_screenPlayBasePath;
}
signals:
void autostartChanged(bool autostart);
void highPriorityStartChanged(bool highPriorityStart);
void sendStatisticsChanged(bool status);
void localStoragePathChanged(QUrl localStoragePath);
void hasWorkshopBannerSeenChanged(bool hasWorkshopBannerSeen);
void decoderChanged(QString decoder);
void setMainWindowVisible(bool visible);
void activeWallpaperCounterChanged(int activeWallpaperCounter);
void pauseWallpaperWhenIngameChanged(bool pauseWallpaperWhenIngame);
void offlineModeChanged(bool offlineMode);
void allLicenseLoaded(QString licensesText);
void allDataProtectionLoaded(QString dataProtectionText);
void setScreenPlayBasePath(QUrl screenPlayBasePath)
{
m_screenPlayBasePath = screenPlayBasePath;
}
QUrl getScreenPlayWidgetPath() const
{
return m_screenPlayWidgetPath;
}
void setScreenPlayWidgetPath(const QUrl& screenPlayWidgetPath)
{
m_screenPlayWidgetPath = screenPlayWidgetPath;
}
bool getOfflineMode() const
{
return m_offlineMode;
}
public slots:
void setMuteAll(bool isMuted);
void setPlayAll(bool isPlaying);
void checkForOtherFullscreenApplication();
void setGlobalVolume(float volume);
void setGlobalFillMode(QString fillMode);
void writeSingleSettingConfig(QString name, QVariant value);
void requestAllLicenses();
void requestAllLDataProtection();
void saveWallpaper(int monitorIndex, QUrl absoluteStoragePath, QStringList properties, QString type);
void setqSetting(const QString& key, const QString& value);
bool autostart() const
{
@ -165,6 +152,25 @@ public slots:
return m_decoder;
}
signals:
void autostartChanged(bool autostart);
void highPriorityStartChanged(bool highPriorityStart);
void sendStatisticsChanged(bool status);
void localStoragePathChanged(QUrl localStoragePath);
void hasWorkshopBannerSeenChanged(bool hasWorkshopBannerSeen);
void decoderChanged(QString decoder);
void setMainWindowVisible(bool visible);
void activeWallpaperCounterChanged(int activeWallpaperCounter);
void pauseWallpaperWhenIngameChanged(bool pauseWallpaperWhenIngame);
void offlineModeChanged(bool offlineMode);
public slots:
void writeSingleSettingConfig(QString name, QVariant value);
void saveWallpaperToConfig(const int monitorIndex, const QUrl& absoluteStoragePath, const QString& type);
void removeWallpaperFromConfig(const int monitorIndex);
void setqSetting(const QString& key, const QString& value);
void setAutostart(bool autostart)
{
if (m_autostart == autostart)
@ -210,8 +216,6 @@ public slots:
emit sendStatisticsChanged(m_sendStatistics);
}
QString loadProject(QString file);
void setLocalStoragePath(QUrl localStoragePath)
{
if (m_localStoragePath == localStoragePath)
@ -222,11 +226,11 @@ public slots:
writeSingleSettingConfig("absoluteStoragePath", cleanedPath);
m_ilm->setabsoluteStoragePath(cleanedPath.toString());
m_installedListModel->setabsoluteStoragePath(cleanedPath.toString());
m_localStoragePath = cleanedPath.toString();
emit localStoragePathChanged(cleanedPath.toString());
m_ilm->reset();
m_ilm->loadInstalledContent();
m_installedListModel->reset();
m_installedListModel->loadInstalledContent();
}
void setDecoder(QString decoder)
@ -239,15 +243,6 @@ public slots:
emit decoderChanged(m_decoder);
}
void setHasWorkshopBannerSeen(bool hasWorkshopBannerSeen)
{
if (m_hasWorkshopBannerSeen == hasWorkshopBannerSeen)
return;
m_hasWorkshopBannerSeen = hasWorkshopBannerSeen;
emit hasWorkshopBannerSeenChanged(m_hasWorkshopBannerSeen);
}
void setActiveWallpaperCounter(int activeWallpaperCounter)
{
if (m_activeWallpaperCounter == activeWallpaperCounter)
@ -290,6 +285,8 @@ public slots:
emit offlineModeChanged(m_offlineMode);
}
void loadActiveProfiles();
private:
void createDefaultConfig();
void setupWidgetAndWindowPaths();
@ -297,12 +294,11 @@ private:
QVersionNumber m_version;
QSettings m_qSettings;
QTranslator m_translator;
ProfileListModel* m_plm;
InstalledListModel* m_ilm;
MonitorListModel* m_mlm;
SDKConnector* m_sdkc;
QTimer* m_checkForOtherFullscreenApplicationTimer;
const shared_ptr<ProfileListModel> m_profileListModel;
const shared_ptr<InstalledListModel> m_installedListModel;
const shared_ptr<MonitorListModel> m_monitorListModel;
const shared_ptr<SDKConnector> m_sdkconnector;
QUrl m_localStoragePath;
QUrl m_localSettingsPath;
@ -310,15 +306,13 @@ private:
QUrl m_screenPlayWidgetPath;
QUrl m_screenPlayBasePath;
bool m_hasWorkshopBannerSeen = false;
bool m_pauseWallpaperWhenIngame = true;
bool m_autostart = true;
bool m_highPriorityStart = true;
bool m_sendStatistics;
QString m_decoder;
int m_activeWallpaperCounter = 0;
QGuiApplication* m_app;
bool m_sendStatistics = false;
bool m_offlineMode = true;
QString m_decoder = "";
int m_activeWallpaperCounter = 0;
};
}

View File

@ -5,7 +5,7 @@ TARGET = $$qtLibraryTarget($$TARGET)
QT += qml quick
CONFIG += plugin c++11
uri = net.aimber.screenplaysdk
uri = ScreenPlay.screenplaysdk
# Input
SOURCES += \

View File

@ -1,2 +1,2 @@
module net.aimber.screenplaysdk
module ScreenPlay.screenplaysdk
plugin ScreenPlaySDK

View File

@ -5,7 +5,7 @@
void ScreenPlay_SDKPlugin::registerTypes(const char *uri)
{
// @uri net.aimber.screenplaysdk
// @uri ScreenPlay.screenplaysdk
qmlRegisterType<ScreenPlaySDK>(uri, 1, 0, "ScreenPlaySDK");
}

View File

@ -14,11 +14,11 @@ void redirectMessageOutputToMainWindow(QtMsgType type, const QMessageLogContext&
//QByteArray function = "function " + QByteArray(context.function) + ", Message: ";
//localMsg = file + line + localMsg;
global_sdkPtr->redirectMessage(localMsg);
switch (type) {
case QtDebugMsg:
//localMsg = " SDK START: " /*+ QByteArray::fromStdString(global_sdkPtr->contentType().toStdString()) + " "*/ + localMsg;
global_sdkPtr->redirectMessage(localMsg);
break;
case QtInfoMsg:
//fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);

View File

@ -4,7 +4,7 @@ QT += qml quick
CONFIG += plugin c++11
TARGET = $$qtLibraryTarget($$TARGET)
uri = net.aimber.sysinfo
uri = ScreenPlay.Sysinfo
# Input
SOURCES += \

View File

@ -1,2 +1,2 @@
module net.aimber.sysinfo
module ScreenPlay.Sysinfo
plugin ScreenPlaySysInfo

View File

@ -13,7 +13,7 @@ QObject* ScreenPlaySysInfoSingleton(QQmlEngine* engine, QJSEngine* scriptEngine)
void ScreenPlaySysInfoPlugin::registerTypes(const char* uri)
{
// @uri net.aimber.sysinfo
// @uri ScreenPlay.Sysinfo
qmlRegisterSingletonType<SysInfo>(uri, 1, 0, "SysInfo", ScreenPlaySysInfoSingleton);
}

View File

@ -1,7 +1,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.3
import net.aimber.screenplaysdk 1.0
import ScreenPlay.screenplaysdk 1.0
Item {
id: mainWindow

View File

@ -2,5 +2,6 @@
<qresource prefix="/">
<file>mainWindow.qml</file>
<file>test.qml</file>
<file>dot.png</file>
</qresource>
</RCC>

BIN
ScreenPlayWindow/dot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -1,8 +1,9 @@
import QtQuick 2.12
import QtWebEngine 1.8
import net.aimber.wallpaper 1.0
import ScreenPlay.Wallpaper 1.0
Rectangle {
id: root
anchors.fill: parent
color: {
if (desktopProperties.color === null) {
@ -12,6 +13,7 @@ Rectangle {
}
}
property bool canFadeIn: true
Component.onCompleted: {
@ -56,6 +58,7 @@ Rectangle {
Loader {
id: loader
anchors.fill: parent
onLoaded: loader.z = 999
}
WebEngineView {
@ -135,8 +138,9 @@ Rectangle {
}
onQmlSceneValueReceived: {
var obj2 = 'import QtQuick 2.12; Item {Component.onCompleted: loader.item.'
var obj2 = 'import QtQuick 2.0; Item {Component.onCompleted: loader.item.'
+ key + ' = ' + value + '; }'
print(key, value)
var newObject = Qt.createQmlObject(obj2.toString(), root, "err")
newObject.destroy(10000)
}
@ -174,4 +178,5 @@ Rectangle {
}
}
}
}

View File

@ -8,8 +8,9 @@ BaseWindow::BaseWindow(QObject* parent)
BaseWindow::BaseWindow(QString projectFilePath, QObject* parent)
: QObject(parent)
{
QApplication::instance()->installEventFilter(this);
qRegisterMetaType<BaseWindow::WallpaperType>();
qmlRegisterType<BaseWindow>("net.aimber.wallpaper", 1, 0, "Wallpaper");
qmlRegisterType<BaseWindow>("ScreenPlay.Wallpaper", 1, 0, "Wallpaper");
if (projectFilePath == "test") {
setType(BaseWindow::WallpaperType::Qml);
@ -76,3 +77,36 @@ BaseWindow::BaseWindow(QString projectFilePath, QObject* parent)
return;
}
}
void BaseWindow::messageReceived(QString key, QString value)
{
if (key == "volume") {
bool ok;
float tmp = value.toFloat(&ok);
if (ok) {
setVolume(tmp);
}
return;
}
if (key == "playbackRate") {
bool ok;
float tmp = value.toFloat(&ok);
if (ok) {
setPlaybackRate(tmp);
}
return;
}
if (key == "loops") {
bool tmp = QVariant(value).toBool();
setLoops(tmp);
return;
}
if (key == "isPlaying") {
bool tmp = QVariant(value).toBool();
setIsPlaying(tmp);
return;
}
}

View File

@ -8,7 +8,7 @@
#include <QJsonParseError>
#include <QObject>
#include <QString>
#include <qqml.h>
#include <QtQml>
class BaseWindow : public QObject {
Q_OBJECT
@ -82,11 +82,7 @@ signals:
public slots:
virtual void destroyThis() {}
virtual void setVisible(bool show) { Q_UNUSED(show) }
virtual void messageReceived(QString key, QString value)
{
Q_UNUSED(key);
Q_UNUSED(value)
}
virtual void messageReceived(QString key, QString value) final;
QString getApplicationPath()
{

View File

@ -13,6 +13,53 @@ BOOL WINAPI SearchForWorkerWindow(HWND hwnd, LPARAM lparam)
return TRUE;
}
HHOOK mouseHook;
QQuickView* winGlobalHook = nullptr;
LRESULT __stdcall MouseHookCallback(int nCode, WPARAM wParam, LPARAM lParam)
{
Qt::MouseButton mouseButton {};
Qt::MouseButtons mouseButtons {};
Qt::KeyboardModifier keyboardModifier {};
QMouseEvent::Type type { QMouseEvent::Type::MouseMove };
if (nCode >= 0) {
switch (wParam) {
case WM_LBUTTONDOWN:
mouseButton = Qt::MouseButton::LeftButton;
mouseButtons.setFlag(Qt::LeftButton);
type = QMouseEvent::Type::MouseButtonPress;
break;
case WM_LBUTTONUP:
mouseButton = Qt::MouseButton::LeftButton;
mouseButtons.setFlag(Qt::LeftButton);
type = QMouseEvent::Type::MouseButtonRelease;
break;
case WM_RBUTTONDOWN:
mouseButton = Qt::MouseButton::RightButton;
mouseButtons.setFlag(Qt::RightButton);
type = QMouseEvent::Type::MouseButtonPress;
break;
}
}
POINT p {};
QPoint point { 0, 0 };
if (GetCursorPos(&p)) {
point.setX(p.x);
point.setY(p.y);
}
auto event = QMouseEvent(type, point, mouseButton, mouseButtons, keyboardModifier);
auto* app = QApplication::instance();
app->sendEvent(winGlobalHook, &event);
return CallNextHookEx(mouseHook, nCode, wParam, lParam);
}
WinWindow::WinWindow(QVector<int>& activeScreensList, QString projectPath, QString id, QString volume)
: BaseWindow(projectPath)
{
@ -59,23 +106,33 @@ WinWindow::WinWindow(QVector<int>& activeScreensList, QString projectPath, QStri
m_window.setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
m_window.setSource(QUrl("qrc:/mainWindow.qml"));
// MUST be called before setting hook for events!
winGlobalHook = &m_window;
if (!(mouseHook = SetWindowsHookEx(WH_MOUSE_LL, MouseHookCallback, nullptr, 0))) {
qDebug() << "Faild to install mouse hook!";
}
// FIXME WORKAROUND:
// There is a strange bug when we open the ScreenPlayWindow project on its one
// that if we set ShowWindow(m_windowHandle, SW_HIDE); we can no longer set
// the window visible via set Visible.
if(projectPath != "test"){
if (projectPath != "test") {
// Let QML decide when were are read to show the window
ShowWindow(m_windowHandle, SW_HIDE);
// ShowWindow(m_windowHandle, SW_HIDE);
}
}
void WinWindow::setVisible(bool show)
{
if (show) {
ShowWindow(m_windowHandle, SW_SHOW);
if (!ShowWindow(m_windowHandle, SW_SHOW)) {
qDebug() << "Cannot set window handle visible";
}
m_window.show();
} else {
ShowWindow(m_windowHandle, SW_HIDE);
if (!ShowWindow(m_windowHandle, SW_HIDE)) {
qDebug() << "Cannot set window handle hidden";
}
}
}
@ -91,10 +148,6 @@ void WinWindow::destroyThis()
QCoreApplication::quit();
}
void WinWindow::messageReceived(QString key, QString value)
{
}
void WinWindow::calcOffsets()
{
for (int i = 0; i < QApplication::screens().count(); i++) {

View File

@ -26,7 +26,6 @@ public:
public slots:
void setVisible(bool show) override;
void destroyThis() override;
void messageReceived(QString key, QString value) override;
private:
void calcOffsets();
@ -34,6 +33,10 @@ private:
void setupWallpaperForAllScreens();
bool searchWorkerWindowToParentTo();
signals:
void qmlSceneValueReceived(const QString key, const QString value);
private:
int m_windowOffsetX = 0;
int m_windowOffsetY = 0;

View File

@ -1,10 +1,104 @@
import QtQuick 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Particles 2.12
import QtQuick.Shapes 1.12
Rectangle {
id: root
anchors.fill: parent
color: Material.color(Material.Grey, Material.Shade800)
property int attStrength: 800000
//Emitter
property bool isEnabled: true
property int emitRate: 250
property int lifeSpan: 5000
property int size: 4
property int endSize: 8
property int sizeVariation: 4
//Image
property real imgOpacity: .75
MouseArea {
id: ma
anchors.fill: parent
hoverEnabled: true
Component.onCompleted: {
attractor.pointX = parent.width * .5
attractor.pointY = 0
}
onPositionChanged: {
setPosition()
if (ma.pressed) {
}
}
onClicked: {
setPosition()
}
function setPosition() {
attractor.pointX = mouseX - 25
attractor.pointY = mouseY - 25
mouseDot.x = mouseX - mouseDot.center
mouseDot.y = mouseY - mouseDot.center
}
}
Rectangle {
id: mouseDot
property int center: mouseDot.width * .5
width: 10
visible: false
height: width
radius: width
color: "orange"
}
Attractor {
id: attractor
system: particleSystem
affectedParameter: Attractor.Acceleration
strength: root.attStrength
proportionalToDistance: Attractor.InverseQuadratic
}
ParticleSystem {
id: particleSystem
}
Emitter {
id: emitter
enabled: root.isEnabled
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
}
width: parent.width
height: parent.height * .5
system: particleSystem
emitRate: root.emitRate
lifeSpan: root.lifeSpan
lifeSpanVariation: 1000
size: root.size
endSize: root.endSize
sizeVariation: root.sizeVariation
velocity: AngleDirection {
angle: -90
magnitude: 50
magnitudeVariation: 25
angleVariation: 10
}
}
ImageParticle {
height: 16
width: 16
source: "dot.png"
system: particleSystem
opacity: root.imgOpacity
}
Text {
id: name
text: qsTr("This is a empty test window. You can change the source in test.qml")

View File

@ -0,0 +1,7 @@
setlocal EnableExtensions
cd Common
cd vcpkg
git pull
call bootstrap-vcpkg.bat
vcpkg.exe install openssl:x64-windows