-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Chef] Fix basicvideoplayer device type #32091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andy31415
merged 16 commits into
project-chip:master
from
erwinpan1:fix_basicvideoplayer_3
Feb 16, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ce21944
[Chef] Fix basicvideoplayer device type
erwinpan1 3ad1832
Rename Data() function to GetXxxxName() function
erwinpan1 a2fa83e
Use `StringBuilder` instead of std::stringstream
erwinpan1 5ae0816
Simplify codes without unnecessary return variables
erwinpan1 5e83fbd
Remove unused static_cast
erwinpan1 9446f0b
Simplify the keypad keycode handling
erwinpan1 a517281
Restyled by clang-format
restyled-commits 314ab90
Enable Chef BasicVideoPlayer in cloud build
erwinpan1 75dbcb3
Remove unused GetInputName & GetOutputName function
erwinpan1 3b4a884
Using struct InputData&OuptutData to refine logics
erwinpan1 28c1705
Add break in default section
erwinpan1 0e60bae
Fix recordingFlag type and remove EMBER_ZCL_STATUS_SUCCESS
erwinpan1 a7c8235
Use std::numeric_limits<uint32_t>::max() as endTime default
erwinpan1 d7a9512
Remove some unneeded namespace declaration
erwinpan1 4c84c9b
Restyled by clang-format
restyled-commits 4fa9b19
Restyled by clang-format
restyled-commits File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
83 changes: 83 additions & 0 deletions
83
examples/chef/common/clusters/audio-output/AudioOutputManager.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <app/util/config.h> | ||
#ifdef MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER | ||
#include "AudioOutputManager.h" | ||
|
||
using namespace std; | ||
using namespace chip::app; | ||
using namespace chip::app::Clusters::AudioOutput; | ||
using chip::app::AttributeValueEncoder; | ||
|
||
AudioOutputManager::AudioOutputManager() | ||
{ | ||
struct OutputData outputData1(1, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 1"); | ||
mOutputs.push_back(outputData1); | ||
struct OutputData outputData2(2, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 2"); | ||
mOutputs.push_back(outputData2); | ||
struct OutputData outputData3(3, chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi, "HDMI 3"); | ||
mOutputs.push_back(outputData3); | ||
|
||
mCurrentOutput = 1; | ||
} | ||
|
||
uint8_t AudioOutputManager::HandleGetCurrentOutput() | ||
{ | ||
return mCurrentOutput; | ||
} | ||
|
||
CHIP_ERROR AudioOutputManager::HandleGetOutputList(AttributeValueEncoder & aEncoder) | ||
{ | ||
return aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { | ||
for (auto const & outputData : mOutputs) | ||
{ | ||
ReturnErrorOnFailure(encoder.Encode(outputData.GetEncodable())); | ||
} | ||
return CHIP_NO_ERROR; | ||
}); | ||
} | ||
|
||
bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & newName) | ||
{ | ||
for (auto & outputData : mOutputs) | ||
{ | ||
if (outputData.index == index) | ||
{ | ||
outputData.Rename(newName); | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
|
||
bool AudioOutputManager::HandleSelectOutput(const uint8_t & index) | ||
{ | ||
for (auto & outputData : mOutputs) | ||
{ | ||
if (outputData.index == index) | ||
{ | ||
mCurrentOutput = index; | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
#endif // MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.